Page 1 of 1
PopupMenu crash
Posted: Tue Oct 18, 2011 3:49 am
by IdeasVacuum
Large-ish project, Pop-up Menus work fine all day long, if you always make a selection from the pop-up. If you pop it up but then do not make a selection (hit the Esc key or click elsewhere), then mouse clicks are no longer detected anywhere by the app.
When I create a small snippet to test, the problem never occurs........... anyone else ever seen this happen?
Re: PopupMenu crash
Posted: Tue Oct 18, 2011 7:38 am
by jesperbrannmark
Yep.
It happens when I
1. Do my enumuration wrong (reuse the same number)
2. Forget to write declarec instead of declare on mac
3. Use openwindowedscreen on some graphic cards (workaround - make sure you do IF startdrawing(xxx) instead of just startdrawing, before drawing your loop do a if iswindow() and dont allow minimize)
4. When my images in the popupmenu is wrong (open them in a paint program, save again.. might be a jpg or png problem) (especially mac)
Re: PopupMenu crash
Posted: Tue Oct 18, 2011 12:14 pm
by IdeasVacuum
Thanks for replying. 2 - 4 do not apply in my case but I'm very curious about 1. I have three Popup Menus, one with a short fixed list and two others whose menu items are dynamically loaded and changed. All three have fixed ID names e.g. #Pop01 (the names are more meaningful in the code).
I have replaced/beautified them with Gonzal's PureCOLOR lib. They look and work fantastic but the 'no pick' issue remains - for now, I have added a ' ** Cancel Pick **' option at the end of each menu, which works fine of course but should not be necessary.........
Edit: When I say the mouse click detection is lost, it is lost for the entire app, cannot click on a button or anything else except tabs. Keyboard input remains fine.
Re: PopupMenu crash
Posted: Tue Oct 18, 2011 6:01 pm
by IdeasVacuum
OK, if the User hits the escape key instead of selecting from the menu pop-up, that is an accelerator keystroke - the pop-up is taken down but the event loop is still running - so detecting #WM_COMMAND to trigger a break does the trick!