Page 1 of 2

Cannot use a menu

Posted: Thu Apr 17, 2025 4:27 am
by dunbarx
I long ago made a Scrabble scorekeeper/tile tracker/timer. Useful if you are into that game.

Used in the IDE, it has a single custom Menu (a grouped button, of course) containing a menuPick handler with a switch statement that deals with a handful of options.

All of a sudden, although the menu works, in the sense that the menuItems it contains do indeed drop down, no menuPick message is sent upon selecting a subMenu. I can, from msg, send a menuPick message along with a parameter to the button itself, and that works just fine. But something has blocked any message from originating from the menu selection process itself.

I have to admit I was fooling around with the stack when I noticed the issue. What is blocking, intercepting, whatever, to the process of selecting a menuItem from that button? In other words, what did I do?

Craig

Re: Cannot use a menu

Posted: Thu Apr 17, 2025 6:04 am
by richmond62
Well, you could post the menu code here.

Re: Cannot use a menu

Posted: Thu Apr 17, 2025 11:47 am
by Klaus
You are CURSED, Craig, get used to it! :D :D :D

Re: Cannot use a menu

Posted: Thu Apr 17, 2025 2:28 pm
by paul@researchware.com
Check the layering of the objects in the group (you said you had a grouped button). Im may be possible the layering got messed up and the menuPick is being sent to an object in the group other than the one with the script in it.

Just a suggestion.

Re: Cannot use a menu

Posted: Thu Apr 17, 2025 4:13 pm
by dunbarx
Thanks for the replies.

@ Richmond. The code itself is not the issue. I can manually send a "menuPick"message to the menu button and it works fine. I just can no longer invoke that message in the usual way.

@Klaus. Finally someone understands.

@Paul. Good point, which I tested yesterday by searching for all "menuPick" handlers in the stack. There is only one, the one in the menu button. The parent group containing that button has no handler.

Craig

Re: Cannot use a menu

Posted: Thu Apr 17, 2025 4:51 pm
by richmond62
Something else is trapping your mouse.
-
th.jpg

Re: Cannot use a menu

Posted: Thu Apr 17, 2025 7:56 pm
by paul@researchware.com
Have you checked the menuMode property of the button to make sure it is set to a type that responds to the menuPick message?

Just another suggestion.

menuPick is likely not broken. Most likely there is some reason the menuPick message is not being delivered to the handler script. menuPick is only sent to button that have an applicable menuMode.

Re: Cannot use a menu

Posted: Thu Apr 17, 2025 8:55 pm
by dunbarx
Paul.

Great suggestion, but the menuMode of the menu button is "pullDown". :(

Craig

Re: Cannot use a menu

Posted: Fri Apr 18, 2025 6:18 pm
by jacque
Try a mouseDown or mouseUp handler in the button just to see if anything works.

Re: Cannot use a menu

Posted: Fri Apr 18, 2025 6:23 pm
by bobcole
Could it be that the button is grouped?
I don't know why that would make a difference.
Bob

Re: Cannot use a menu

Posted: Sat Apr 19, 2025 8:16 pm
by dunbarx
Jacque. Nothing. I even tried "mouseEnter", but the menu button is not really in the menuBar, no? So that makes no sense.

Bob. I think all such buttons, especially when built with the Menu Builder, are grouped. Mine is.

Craig

Re: Cannot use a menu

Posted: Sun Apr 20, 2025 3:46 am
by FourthWorld
dunbarx wrote:
Thu Apr 17, 2025 4:13 pm
The code itself is not the issue.
But something is. If you can reproduce it in a stack that illustrates the issue, posting the stack will give us something to work with.

Re: Cannot use a menu

Posted: Sun Apr 20, 2025 5:52 pm
by jacque
I assume this is on Mac? Is it possible that the menu group was duplicated and the wrong one is being used as a menu bar? Wild guess, I know.

Re: Cannot use a menu

Posted: Mon Apr 21, 2025 3:00 pm
by dunbarx
@Richard. There always is, eh?

@ Jacque. On a Mac. Each stack has five groups, all identical. The menuButton has the same name and owner

I opened an older saved version of my stack, where all works just fine. With both stacks, I did the following:

1- Compared "the properties" of each stack, old and new. They are identical.
2- Each stack has five groups, one of which is the menuButton group. Same group name, same button name in each. Identical scripts in each.

Considering the above two items, I cannot understand why, even though the menu "action" works just fine, no "menuPick" is invoked in the newer stack. This is verified on two different machines.

I am happy to play with this as long as others are willing to, and happy to post my stack, especially if other Scrabble players are interested. I can fix my problem, yet again without understanding it, by simply going back to the old version and update it as per my original intent.

Craig

Re: Cannot use a menu

Posted: Mon Apr 21, 2025 3:55 pm
by richmond62
Fixing without understanding is an extremely short-term way of looking at things.