home *** CD-ROM | disk | FTP | other *** search
- Path: pn.itnet.it!not-for-mail
- From: "Stefano Agostinelli" <agos001@pn.itnet.it>
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Help me with a basic MUI program PLEASE?
- Date: Tue, 09 Jan 1996 20:39:05 +0100
- Organization: ITnet
- Message-ID: <65641108%agos001@pn.itnet.it>
- References: <2440.6581T1279T1051@in.net>
- NNTP-Posting-Host: agos001.pn.itnet.it
- X-NewsReader: IntuiNews 1.3 (27.8.95)
-
- John J. Maver wrote in comp.sys.amiga.programmer about "Help me with a basic MUI
- program PLEASE?":
- >
- >
- > Could someone please help me with MUI? I have started trying to use
- > MUIBuilder,and I can't seem to make a good main.c to control the code it
- > generates. I am new to MUI. All I want to know is how to open the window
- > and then when the person hits the close gadget, have the window close. With
- > my existing main.c. the window opens and is open for good!!
- >
- > Is there a good reference for MUI? Some basic examples, not some 18 part
- > multiprogram.
-
- I've looked at your code...well I don't like it. MUIBuilder is useless
- imho: it's much better to write applications "by hand" using MUI C macros.
- For some good serious MUI C example take mui31dev.lha from Aminet and
- have a in depth look at the demo code:you can find basic and not-so-basic
- examples there.
- Ok let's examine the code you posted...
-
- > struct ObjApp { APTR App; APTR WI_label_0; };
-
- This is pure crap imho. Build a subclass for that...no it's not difficult!
- Just look at some examples in mui31dev packet.
-
- > DoMethod(Object->WI_label_0, MUIM_Window_SetCycleChain, 0 );
-
- Useless and btw MUIM_Window_SetCycleChain is obsolete.
-
- > set(Object->WI_label_0, MUIA_Window_Open, TRUE );
-
- Ok,now you have opened your window.In order to close automatically
- just tell MUI to notify your window when the user hits the close gadget
- and quit the application.You can done this by adding:
-
- DoMethod(Object->WI_label_0,MUIM_Notify,MUIA_Window_CloseRequest,TRUE,Object->App,2,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit);
-
- or to close the window just add
-
- DoMethod(Object->WI_label_0,MUIM_Notify,MUIA_Window_CloseRequest,TRUE,Object->WI_label_0,3,MUIM_Set,MUIA_Window_Open,FALSE);
-
- Hope this helps.
-
- Cheers
- Stefano
-
- +-----------------------------+-----------------------------------------+
- | Stefano Agostinelli | Now developing for You ARM: |
- | Genoa - Italy | the State of Art AmigaRoleMaster System |
- +-----------------------------+-----------------------------------------+
- | IRC: arm | 'Where are you going, Master?' |
- | E-mail: agos001@pn.itnet.it | 'To the Havens, Sam' |
- +-----------------------------+-----------------------------------------+
-
-