Test initialisation of MUIA_List_AdjustWidth and MUIA_List_AdjustHeight, and
[AROS.git] / workbench / libs / muimaster / tutorial / examples / VGroup.c
blob23aae256cd0ce4084a8e5e1d0b112e9fddbdc5de
1 /*
2 Copyright © 2003-2011, The AROS Development Team.
3 All rights reserved.
5 $Id$
6 */
8 /* "muizunesupport.h" contains misc includes and
9 init stuff which is not important at the moment. */
11 #include "muizunesupport.h"
14 /* Objects */
16 Object *app;
17 Object *WD_Main;
18 Object *BT_1, *BT_2, *BT_3;
21 /****************************************************************
22 Allocate resources for gui
23 *****************************************************************/
25 BOOL init_gui(void)
27 app = ApplicationObject,
28 MUIA_Application_Title , (IPTR) "VGroup",
29 MUIA_Application_Version , (IPTR) "$VER: VGroup 0.1 (14.01.03)",
30 MUIA_Application_Copyright , (IPTR) "© 2003-2011, The AROS Development Team",
31 MUIA_Application_Author , (IPTR) "The AROS Development Team",
32 MUIA_Application_Description, (IPTR) "Layout with VGroup",
33 MUIA_Application_Base , (IPTR) "VGroup",
35 SubWindow, WD_Main = WindowObject,
36 MUIA_Window_Title, (IPTR) "Layout with VGroup",
38 WindowContents,
41 Layout: VGroup - Three buttons in one vertical column
43 | Button 1 |
44 | Button 2 |
45 | Button 3 |
48 VGroup,
49 Child, BT_1 = SimpleButton("Button 1"),
50 Child, BT_2 = SimpleButton("Button 2"),
51 Child, BT_3 = SimpleButton("Button 3"),
52 End, /* VGroup */
54 End, /* WindowObject */
56 End; /* ApplicationObject */
58 if(app)
60 /* Quit application if the windowclosegadget or the esc key is pressed. */
62 DoMethod(WD_Main, MUIM_Notify, MUIA_Window_CloseRequest, TRUE,
63 app, 2,
64 MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
66 return(TRUE);
69 return(FALSE);
70 } /* init_gui(void) */
73 /****************************************************************
74 Deallocates all gui resources
75 *****************************************************************/
77 void deinit_gui(void)
79 if(app){MUI_DisposeObject(app);}
80 } /* deinit_gui(void) */
84 /****************************************************************
85 The message loop
86 *****************************************************************/
88 void loop(void)
90 ULONG sigs = 0;
92 while((LONG) DoMethod(app, MUIM_Application_NewInput, &sigs) != MUIV_Application_ReturnID_Quit)
94 if (sigs)
96 sigs = Wait(sigs | SIGBREAKF_CTRL_C | SIGBREAKF_CTRL_D);
97 if(sigs & SIGBREAKF_CTRL_C){break;}
98 if(sigs & SIGBREAKF_CTRL_D){break;}
101 } /* loop(void) */
104 /****************************************************************
105 The main entry point
106 *****************************************************************/
108 int main(int argc, char *argv[])
110 if(open_libs())
112 if(init_gui())
114 set(WD_Main, MUIA_Window_Open, TRUE);
116 if(xget(WD_Main, MUIA_Window_Open))
118 loop();
121 set(WD_Main, MUIA_Window_Open, FALSE);
123 deinit_gui();
126 close_libs();
129 return RETURN_OK;
130 } /* main(int argc, char *argv[]) */