Amiga.org
Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: Kronos on September 02, 2003, 09:30:54 PM
-
Chapter 1, Menus:
O.k. I did add some menus to my win-object by giving a normal NewMenu-array
to MUI_MakeObject, and they do appear.
I also set different constants to the nm_UserData-field, and that appears as
id = DoMethod(app,MUIM_Application_Input,&signals)
But that not what I want :-o
I want to connect the menus to my costum class, via MUIM_Notify, prefered in a
way where the Menu-titles would reflect in the Method-ID and the MenuItem
in the next field of that message.
That allready works that way with the speedbar-object, so it should be possible.
-
DoMethod(_win(obj), MUIM_Notify, MUIA_Window_MenuAction, MUIV_EveryTime, obj, 2, MUIM_MySubClass_MenuThingy, MUIV_TriggerValue);
I never used menus this way though. Read MUI_Window.doc/MUIA_Window_MenuAction and you get the idea :-)
-
#DOH#
Took quite a while till I got that to work.
Seems MUI doesn't like it when some menus have a 0 in the userdata before the
ones I wanted to get running ......
Well thats life ;)
Menus are used that way cos they are mainly used for setting parameters of my
class, and redirecting those that are not back to "app" seemed easier than
sorting them in the main-loop, finding which windows they belong to, and
than notifying my class ....
-
Yeah, it is Kaptein Kronos on his neverending voyage again ;)
PopUps are what we gonna learn in this chapter ....
1st we set our goal:
We want an colorfield-object that pops up an coloradjust-object.
Now I know that there is Poppen, but that gives you an
Pendajust-object something that is simply overkill for
this purpose (and a pain to use).
Here are some snippets:
a = MUI_NewObject(MUIC_Coloradjust,TAG_DONE);
c = MUI_NewObject(MUIC_Colorfield,MUIA_InputMode,MUIV_InputMode_Immediate,TAG_DONE);
b = MUI_NewObject(MUIC_Popobject,
MUIA_Popstring_Button, PopButton(MUII_PopUp),
MUIA_Popobject_Object, a,
TAG_DONE);
.
.
.
Child, HGroup,
Child, HSpace(0),
Child, c,
Child, b,
.
.
.
DoMethod(c,MUIM_Notify,MUIA_Pressed,TRUE, b,1,MUIM_Popstring_Open);
This does work o.k. sofar, but I want to get rid of that popup-button
(the small one with the arrow down), but sofar everything I
tried to make it invisible ended in either a crash, or the whole
popup being lost.
-
*bump*