EventSource and Event_MenuAction ?

BlitzMax Forums/MaxGUI Module/EventSource and Event_MenuAction ?

Gabriel(Posted 2006) [#1]
What is EventSource() supposed to return when an EVENT_MENUACTION event is raised? At first I thought it would surely be the handle of the "window" ( gadget ) you pass with PopUpWindowMenu but it isn't. So I tried the handle of the menu but it's not that either.

So what is it supposed to be? I'm running out of things to try here.

EDIT: OK, it's Null. Why is it Null? Isn't it supposed to have some data in here?

Oh, and BTW it's a textarea, if that makes a difference.


Fabian.(Posted 2006) [#2]
MaxGUI still works with menu ids as BlitzPlus did, maybe thats the reason BlitzMax sets the event source to Null. You should have a constant for each menu item and then check what event data is. But I think since BMX is an OOP language it isn't needed anymore, it would be quite better to store object references in variables than these constants. The problem of constants is that they're global, and globals are really annoying when you try to combine code.
So for my personal taste BlitzMax should store a reference to the menu gadget or at least the menu's parent ( then the menu itself could be the event extra ) as event data.