Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widget tooltips #1019

Merged
merged 8 commits into from
Sep 9, 2021
Merged

Widget tooltips #1019

merged 8 commits into from
Sep 9, 2021

Conversation

corranwebster
Copy link
Contributor

With #1013 merged, it's now possible to move tooltip code from Fields to Widgets, so all widgets can have a tooltip. This is PR does a fairly straightforward shift of the code between the two classes, and updates tests and documentation appropriately.

Code that uses tooltips on Fields should notice no change.

@rahulporuri
Copy link
Contributor

@corranwebster CI seems to be failing with wx -


======================================================================
FAIL: test_field_tooltip (pyface.tests.test_widget.TestWidgetCommon)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/pyface/pyface/.edm/envs/pyface-test-3.6-wx/lib/python3.6/site-packages/pyface/testing/widget_mixin.py", line 57, in test_field_tooltip
    self._create_widget_control()
  File "/home/runner/work/pyface/pyface/.edm/envs/pyface-test-3.6-wx/lib/python3.6/site-packages/pyface/testing/widget_mixin.py", line 41, in _create_widget_control
    self.widget._create()
  File "/home/runner/work/pyface/pyface/.edm/envs/pyface-test-3.6-wx/lib/python3.6/site-packages/pyface/i_widget.py", line 134, in _create
    self.control = self._create_control(self.parent)
  File "/home/runner/work/pyface/pyface/.edm/envs/pyface-test-3.6-wx/lib/python3.6/site-packages/pyface/tests/test_widget.py", line 36, in _create_control
    control = wx.Window(parent)
wx._core.wxAssertionError: C++ assertion "Assert failure" failed at /home/vagrant/wxPython-4.0.7.post2/ext/wxWidgets/src/gtk/window.cpp(2474) in Create(): wxWindowGTK creation failed

----------------------------------------------------------------------

@corranwebster
Copy link
Contributor Author

Yep, pushed a fix (was being lazy about testing locally because I didn't want to clobber my development environment).

Copy link
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM with a couple of necessary changes

Co-authored-by: Poruri Sai Rahul <[email protected]>
@corranwebster
Copy link
Contributor Author

Looks like _remove_event_listeners is being called twice.

@corranwebster
Copy link
Contributor Author

The calling chain for destroy was not correct. The latest commit adds a mixin destroy method that ensures _remove_event_listeners gets called exactly once.

This exposed a bug in the close method of SingleChoiceDialog so this PR also fixes that (the thing being tested wasn't particularly important - it was testing the value of the choice when the user cancels, which we shouldn't really care about at all).

@corranwebster
Copy link
Contributor Author

Looks like some other double-disconnects on the wx side 😞

Copy link
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the fixes.

@corranwebster corranwebster merged commit 72a27a0 into main Sep 9, 2021
@corranwebster corranwebster deleted the enh/widget-tooltips branch September 9, 2021 08:51
@corranwebster corranwebster restored the enh/widget-tooltips branch September 9, 2021 10:37
@corranwebster corranwebster deleted the enh/widget-tooltips branch September 9, 2021 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants