enthought / pyface

pyface: traits-capable windowing framework
Other
105 stars 55 forks source link

Bug report: wx DrawText/DrawBitmap float issue #1132

Closed opoplawski closed 2 years ago

opoplawski commented 2 years ago

Environment

OS: Fedora Rawhide (F37) Python version: 3.10 Toolkit: Wx wxpython4-4.0.7 wxGTK3-3.0.5.1

Description

Errors when running the traitsui testsuite:

test_custom_button_editor_clicked (traitsui.tests.editors.test_button_editor.TestButtonEditor) ... /usr/lib/python3.10/site-packages/pyface/ui/wx/image_button.py:96: PendingDeprecationWarning: automatic widget creation is deprecated and will be removed in a future Pyface version, use create=False and explicitly call create() for future behaviour
  warnings.warn(
Unexpected error captured in sys excepthook. 
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pyface/ui/wx/image_button.py", line 258, in _on_paint
    wdc.DrawText(self.label, ox + self._tx, oy + self._ty)
TypeError: DC.DrawText(): arguments did not match any overloaded call:
  overload 1: argument 2 has unexpected type 'float'
  overload 2: argument 2 has unexpected type 'float'

ERROR
test_custom_button_editor_disabled (traitsui.tests.editors.test_button_editor.TestButtonEditor) ... Unexpected error captured in sys excepthook. 
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pyface/ui/wx/image_button.py", line 258, in _on_paint
    wdc.DrawText(self.label, ox + self._tx, oy + self._ty)
TypeError: DC.DrawText(): arguments did not match any overloaded call:
  overload 1: argument 2 has unexpected type 'float'
  overload 2: argument 2 has unexpected type 'float'

ERROR
test_custom_image_value (traitsui.tests.editors.test_button_editor.TestButtonEditor) ... Unexpected error captured in sys excepthook. 
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pyface/ui/wx/image_button.py", line 252, in _on_paint
    wdc.DrawBitmap(image, ox + self._ix, oy + self._iy, True)
TypeError: DC.DrawBitmap(): arguments did not match any overloaded call:
  overload 1: argument 2 has unexpected type 'float'
  overload 2: argument 2 has unexpected type 'float'

ERROR

Steps to Reproduce

+ export ETS_TOOLKIT=wx
+ unset QT_API
+ export EXCLUDE_TESTS=qt
+ xvfb-run /usr/bin/python3 -s -m unittest discover -v traitsui
corranwebster commented 2 years ago

Thanks for the report.

Fixed by #1119