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

WxAppWrap mouse events not caught with pygfx #115

Open
gselzer opened this issue Jan 22, 2025 · 2 comments
Open

WxAppWrap mouse events not caught with pygfx #115

gselzer opened this issue Jan 22, 2025 · 2 comments

Comments

@gselzer
Copy link
Collaborator

gselzer commented Jan 22, 2025

If you debug the following python script, and put breakpoints on WxWAppWrap.filter_mouse_events' on_mouse_move/on_mouse_press/on_mouse_release functions, you'll never hit the breakpoint. Works just fine when using vispy instead.

from __future__ import annotations

import ndv
import os

os.environ["NDV_GUI_FRONTEND"] = "wx"
os.environ["NDV_CANVAS_BACKEND"] = "pygfx"

try:
    img = ndv.data.cells3d()
except Exception as e:
    print(e)
    img = ndv.data.nd_sine_wave((10, 3, 8, 512, 512))

viewer = ndv.imshow(img)

The fix is likely something similar to this - I may just fix it as a part of #114 which really wants this to work.

@tlambert03
Copy link
Member

Was looking closer at the pygfx code, and I think we might also want to look into whether we could actually just use that subwidget class (which is also publicly exposed) rather than the higher level canvas widget that we use. On mobile so can’t link easily atm

@gselzer
Copy link
Collaborator Author

gselzer commented Jan 22, 2025

Sure, I will take a look tomorrow

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

No branches or pull requests

2 participants