I'm struggling trying to convert the handle that is passed to an event
handler into a resource ID. I've got something like this in place:

menubar = .BinaryMenubar~new
popup = .Popupmenu~new(100)
menubar~insertpopup(1,101,popup,"File",,,.true)

menubar~attachTo(self)
menubar~connectMenuEvent(onInitMenu,"INITMENU")

::method onInitMenu unguarded
use arg hmenu

I've tried various things to convert hmenu to a resource ID so that I can
take action when the ID is 100 in this case, i.e. when the user presses
"File" on the menu bar. But nothing seems to work. Examples:

a = menuBar~getPopup(100)
id = a~getHandle
if id = hmenu then say "You pressed 'File'"

This doesn't get a match.

a = menuBar~getPopup(100)
id = a~getControlID(hmenu)

This causes a rexx environment crash.

id = menubar~getControlID(hmenu)

This causes a rexx environment crash.

id = self~getControlID(hmenu)

This returns -1, meaning hmenu is not a valid handle.

So what's the secret please? (I've checked but haven't found any example
code.)

Staffan
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to