Canvas Click not responding

I have a canvas that I am using on as a button (Mouse up). It works fine while testing on the App’s main window. If I copy and paste it onto another window which is displayed through showmodal, the canvas doesn’t respond.
What could be stopping the event happening? Suggestions?

Not a very helpful reply, but I just tried it in my environment and it worked fine.

Be sure that it is enabled in its new window (that slider in the IDE was not inadvertently slid to disabled.)

When you copied it, did the “return true” in the MouseDown event somehow not make it to the new window?

1 Like

Have you confirmed in the debugger what is happening? Does the mousedown event (if any) occur? Does the mouseup event occur?

What testing have you actually done?

1 Like

Right between the eyes !

The doc states:
This event will not occur unless you return True in the MouseDown event. The return value is ignored.

Yes I have the Return True in the MouseDown event. When you click on the window it makes the Modal sound that you usually get when you click outside the Window rect. Can timers on the parent window have any effect on the modal window behaviour?

What. Testing. Have. You. Actually. Done. ??

Its a known bug <https://xojo.com/issue/19233>

2 Likes

I think OP is using macOS and that bug is Windows specific, no?

What version of Xojo and macOS are you using? I don’t see that behavior with a simple project in 2020r2 (unless I didn’t understand the issue correctly).

So it is, Martin has probably found an edge case for macOS

@Martin_Fitzgibbons can you replicate it in a small demo project you can upload, it’ll shed light on things like your platform, xojo version, how you’re opening the window, etc etc

It doesn’t happen in a simple reconstruction. I have also noticed in the project that the close button and other canvass don’t trigger events. It’s the active window but behaves like there is another modal window open but there isn’t

Thanks Julian, even though that is a Windows issue it has me thinking on a method I have running from a timer where I use ‘exit sub’ I haven’t had this issue before and it’s the first time I have used exit sub so maybe a correlation (or a rabbit hole)

Latest Xojo Catalina 15.7. I think it is more likely my programming rather than the system or Xojo

How/when are you calling the showmodal, in the action event of a button or something else? and what is the type of the original window and the type of the new window?

If you put a breakpoint after your ShowModal does it get there while the window is still open?

If you disable that timer does the problem stop?

Just did that again to see where it goes. There are 2 timers on the showmodal window that do animations in canvases, following the path one animation stops after 4 iterations which is correct and the other goes indefinitely which is correct when I resume the whole window is not accessible but the animations is still running and the close button is red and unaccessible?

I mean where you make the call to open the modal window with showmodal on the very next line type in break, does it hit that while the modal window is actually shown i.e. is it continuing on past the showmodal line or does it only hit that break once you close the modal window?