2 Copyright © 2003, The AROS Development Team.
8 /* "muizunesupport.h" contains misc includes and
9 init stuff which is not important at the moment. */
11 #include "muizunesupport.h"
18 Object
*TX_Info
, *BT_Hello
, *BT_Reset
;
21 /****************************************************************
22 Allocate resources for gui
23 *****************************************************************/
27 app
= ApplicationObject
,
28 MUIA_Application_Title
, (IPTR
) "Notify",
29 MUIA_Application_Version
, (IPTR
) "$VER: HelloZune 0.1 (14.01.03)",
30 MUIA_Application_Copyright
, (IPTR
) "© 2003, The AROS Development Team",
31 MUIA_Application_Author
, (IPTR
) "The AROS Development Team",
32 MUIA_Application_Description
, (IPTR
) "How to use MUIM_Notify",
33 MUIA_Application_Base
, (IPTR
) "NOTIFY",
36 SimpleButton("Hello Notify") -> Set text to "Hello Notify! Press reset"
37 SimpleButton("Reset text") -> Reset text back to "Please press 'Hello MUIM_Notify'"
40 SubWindow
, WD_Main
= WindowObject
,
41 MUIA_Window_Title
, (IPTR
) "How to use MUIM_Notify",
43 WindowContents
, VGroup
,
45 Child
, TX_Info
= SimpleText("Please press 'Hello Notify'"),
49 Child
, BT_Hello
= SimpleButton("Hello Notify"),
50 Child
, BT_Reset
= SimpleButton("Reset text"),
54 End
, /* WindowObject */
56 End
; /* ApplicationObject */
60 /* Bring buttons to live with MUIM_Notify. */
62 DoMethod(BT_Hello
, MUIM_Notify
, /* Source object which triggers the notification. */
63 MUIA_Pressed
, FALSE
, /* Trigger if the button is released (MUIA_Pressed -> FALSE) */
64 TX_Info
, /* Destination object to recieve the notification. */
65 3, /* Send three parameters. */
66 /* Set MUIA_Text_Contents to given string. */
67 MUIM_Set
, MUIA_Text_Contents
, (IPTR
) "Hello Notify! Press reset");
70 DoMethod(BT_Reset
, MUIM_Notify
, /* Source object which triggers the notification. */
71 MUIA_Pressed
, FALSE
, /* Trigger if the button is released (MUIA_Pressed -> FALSE) */
72 TX_Info
, /* Destination object to recieve the notification. */
73 3, /* Send three parameters. */
74 /* Set MUIA_Text_Contents to given string. */
75 MUIM_Set
, MUIA_Text_Contents
, (IPTR
) "Please press 'Hello Notify'");
78 /* Quit application if the windowclosegadget or the esc key is pressed. */
80 DoMethod(WD_Main
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
82 MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
88 } /* init_gui(void) */
91 /****************************************************************
92 Deallocates all gui resources
93 *****************************************************************/
97 if(app
){MUI_DisposeObject(app
);}
98 } /* deinit_gui(void) */
102 /****************************************************************
104 *****************************************************************/
110 while((LONG
) DoMethod(app
, MUIM_Application_NewInput
, &sigs
) != MUIV_Application_ReturnID_Quit
)
114 sigs
= Wait(sigs
| SIGBREAKF_CTRL_C
| SIGBREAKF_CTRL_D
);
115 if(sigs
& SIGBREAKF_CTRL_C
){break;}
116 if(sigs
& SIGBREAKF_CTRL_D
){break;}
122 /****************************************************************
124 *****************************************************************/
126 int main(int argc
, char *argv
[])
132 set(WD_Main
, MUIA_Window_Open
, TRUE
);
134 if(xget(WD_Main
, MUIA_Window_Open
))
139 set(WD_Main
, MUIA_Window_Open
, FALSE
);
146 } /* main(int argc, char *argv[]) */