I think that I’m looking for one of two things–either would serve my purpose:
- Given a PGButton, a means of getting the “command”-method given when it was originally constructed as a DirectButton.
- Given a PGButton that may or may not be one of the item-buttons of a DirectOptionMenu, a means of finding that menu, if it exists.
For the former, I think that I might be able to find it by querying the Messenger object–but that looks like a convoluted path, and I want to check for a simpler route before embarking on it.
For the latter, I could search the node’s ancestors–but I think that a DirectOptionMenu would appear there as just a PGButton, with no apparent access to the DirectOptionMenu, and thus its “set” method.
To explain, I’m working on controlling my menus via non-mouse inputs. As part of this, I want to be able to open a DirectOptionMenu, select an item in the popup-menu, and to then call its command on pressing the relevant “action”-button. The first two I’ve achieved; the last is my current stumbling-block.
When dealing with DirectButtons that I’ve constructed myself, I can store them and thus simply call their “commandFuncs”. But when I select and activate a button in a DirectOptionMenu’s popup-menu, all that I (apparently) have access to is the PGButton form of the UI-element, which doesn’t seem to store its “commandFunc”, or a reference to its DirectOptionMenu.
Of course, I’m very much open to alternative solutions!