grub2: bring back build of aros-side grub2 tools
[AROS.git] / test / Zune / poplist.c
blob7eadb378d0e3d71e81876845a75c8b3d38fe91fd
1 /*
2 Copyright © 2002, The AROS Development Team.
3 All rights reserved.
5 $Id$
6 */
8 #include <exec/types.h>
9 #include <stdlib.h>
10 #include <stdio.h>
11 #include <string.h>
13 #include <dos/dos.h>
14 #include <intuition/gadgetclass.h>
15 #include <intuition/icclass.h>
16 #include <proto/exec.h>
17 #include <proto/intuition.h>
18 #include <proto/muimaster.h>
19 #include <clib/alib_protos.h>
21 /* the following should go in a single include file which then only
22 ** constits of the public constants and members. Actually this is easiey
25 #include <libraries/mui.h>
27 struct Library *MUIMasterBase;
29 Object *app;
31 char *listentries[] = {"One", "Two", "Three", "Four", NULL};
33 int main(void)
35 Object *wnd;
37 MUIMasterBase = (struct Library*)OpenLibrary("muimaster.library",0);
39 app = ApplicationObject,
40 SubWindow, wnd = WindowObject,
41 MUIA_Window_Title, "poplist",
42 MUIA_Window_Activate, TRUE,
44 WindowContents, VGroup,
45 Child, PoplistObject,
46 MUIA_Popstring_String, StringObject, StringFrame, End,
47 MUIA_Popstring_Button, PopButton(MUII_PopUp),
48 MUIA_Poplist_Array, (IPTR)listentries,
49 End,
50 End,
51 End,
52 End;
54 if (app)
56 ULONG sigs = 0;
58 DoMethod
60 wnd, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, (IPTR) app,
61 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit
64 set(wnd,MUIA_Window_Open,TRUE);
66 while (DoMethod(app, MUIM_Application_NewInput, (IPTR) &sigs) != MUIV_Application_ReturnID_Quit)
68 if (sigs)
70 sigs = Wait(sigs | SIGBREAKF_CTRL_C | SIGBREAKF_CTRL_D);
71 if (sigs & SIGBREAKF_CTRL_C) break;
72 if (sigs & SIGBREAKF_CTRL_D) break;
76 MUI_DisposeObject(app);
79 CloseLibrary(MUIMasterBase);
81 return 0;