Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

tohc1
Copy link
Contributor

@tohc1 tohc1 commented Jul 31, 2025

Fix display of figure window mouse coordinates using wx python backends.
Currently the mouse coordinates are not visible when using the wx python backend.

This sets an initial size to the text control used to display the coordinates currently the width is set to 0 when NavigationToolbar2Wx.Realize() is called as there is no label text specified and no size defined.

Setting an initial size of (120,-1) should work for most systems unless the font size is very large.
Alternatively NavigationToolbar2Wx.Realize() can be called in NavigationToolbar2Wx. set_message() after the label text is set so that space in the toolbar is allocated however this causes flickering.

I found a related bug [Bug]: wx + windows draws mouseover cursor text beyond the toolbar's extents #22014
closes #22014

PR summary

PR checklist

Fix display of figure window mouse cordinates using wx python backends.

Label text requires an initial size to be given to have none zero dimensions in toolbar.
@anntzer
Copy link
Contributor

anntzer commented Jul 31, 2025

Does the patch at #22014 (comment) (plus version gating to only do it on Windows) not work for you? That would seem better than hardcoding a size...

@tohc1
Copy link
Contributor Author

tohc1 commented Aug 1, 2025 via email

@anntzer
Copy link
Contributor

anntzer commented Aug 25, 2025

See #30466 for the full implementation of #22014 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: wx + windows draws mouseover cursor text beyond the toolbar's extents
2 participants