[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] XaAES: menus in windows - window handle?
On 08/09/2010 05:24 PM, Lonny Pursell wrote:
> Well, this is simple. The old menu message should be left alone, and a
> completely new message defined for menus inside windows. That's the obvious
> way to maintain backward compatibility. Anything else is just insane if it
> starts breaking all the GEM apps already out there. :-P
If I'm not mistaken the normal/standard menu is just a menu widget
belonging to the root window. So window-menus behaves and works exactly
as the "normal" menu. I suggest a simple modification to detect whether
a menu event comes from the root window or not:
1. Root window (normal menu): Leave it like today.
2. Any other window: Send -(window handle) instead of sender's apid.
So if msg[1] (IIRC) is negative, it's the handle of the window that owns
the menu. So the window becomes the sender. This doesn't break anything
and it's easy to detect where the window message comes from.
Jo Even