Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / libs / muimaster / tutorial / examples / VHGroup2.c
blob956b5e3a46b2f1d7881200b4db695de867b32670
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_11_13;
19 Object *BT_21, *BT_22, *BT_23;
20 Object *BT_31, *BT_32_33;
23 /****************************************************************
24 Allocate resources for gui
25 *****************************************************************/
27 BOOL init_gui(void)
29 app = ApplicationObject,
30 MUIA_Application_Title , (IPTR) "VHGroup2",
31 MUIA_Application_Version , (IPTR) "$VER: VHGroup2 0.1 (14.01.03)",
32 MUIA_Application_Copyright , (IPTR) "© 2003-2011, The AROS Development Team",
33 MUIA_Application_Author , (IPTR) "The AROS Development Team",
34 MUIA_Application_Description, (IPTR) "Layout with VGroup + HGroup 2",
35 MUIA_Application_Base , (IPTR) "VHGroup2",
37 SubWindow, WD_Main = WindowObject,
38 MUIA_Window_Title, (IPTR) "Layout with VGroup + HGroup 2",
41 Start VGroup of window here. All other GUI objects are childs
42 of this VGroup.
45 WindowContents, VGroup,
48 Layout: VGroup + HGroup for a more complex layout
50 A group could have any size and can contain any number of
51 GUI objects. This allows more complex layouts.
53 | Button 1.1 - 1.3 |
54 | Button 2.1 | | Button 2.2 | | Button 2.3 |
55 | Button 3.1 | | Button 3.2 - 3.3 |
59 /* Horizontal line 1 */
61 Child, HGroup,
62 Child, BT_11_13 = SimpleButton("Button 1.1 - 1.3"),
63 End, /* HGroup */
66 /* Horizontal line 2 */
68 Child, HGroup,
69 Child, BT_21 = SimpleButton("Button 2.1"),
70 Child, BT_22 = SimpleButton("Button 2.2"),
71 Child, BT_23 = SimpleButton("Button 2.3"),
72 End, /* HGroup */
75 /* Horizontal line 3 */
77 Child, HGroup,
78 Child, BT_31 = SimpleButton("Button 3.1"),
79 Child, BT_32_33 = SimpleButton("Button 3.2 - 3.3"),
80 End, /* HGroup */
82 End, /* VGroup */
84 End, /* WindowObject */
86 End; /* ApplicationObject */
88 if(app)
90 /* Quit application if the windowclosegadget or the esc key is pressed. */
92 DoMethod(WD_Main, MUIM_Notify, MUIA_Window_CloseRequest, TRUE,
93 app, 2,
94 MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
96 return(TRUE);
99 return(FALSE);
100 } /* init_gui(void) */
103 /****************************************************************
104 Deallocates all gui resources
105 *****************************************************************/
107 void deinit_gui(void)
109 if(app){MUI_DisposeObject(app);}
110 } /* deinit_gui(void) */
114 /****************************************************************
115 The message loop
116 *****************************************************************/
118 void loop(void)
120 ULONG sigs = 0;
122 while((LONG) DoMethod(app, MUIM_Application_NewInput, &sigs) != MUIV_Application_ReturnID_Quit)
124 if (sigs)
126 sigs = Wait(sigs | SIGBREAKF_CTRL_C | SIGBREAKF_CTRL_D);
127 if(sigs & SIGBREAKF_CTRL_C){break;}
128 if(sigs & SIGBREAKF_CTRL_D){break;}
131 } /* loop(void) */
134 /****************************************************************
135 The main entry point
136 *****************************************************************/
138 int main(int argc, char *argv[])
140 if(open_libs())
142 if(init_gui())
144 set(WD_Main, MUIA_Window_Open, TRUE);
146 if(xget(WD_Main, MUIA_Window_Open))
148 loop();
151 set(WD_Main, MUIA_Window_Open, FALSE);
153 deinit_gui();
156 close_libs();
159 return RETURN_OK;
160 } /* main(int argc, char *argv[]) */