grub2: bring back build of aros-side grub2 tools
[AROS.git] / test / Zune / dirlist.c
blob8887344b610d904ea62185cd9dfa3e7ff29096c1
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 int main(void)
33 Object *wnd, *str, *dirlist, *page;
35 MUIMasterBase = (struct Library*)OpenLibrary("muimaster.library",0);
37 app = ApplicationObject,
38 SubWindow, wnd = WindowObject,
39 MUIA_Window_Title, "dirlist",
40 MUIA_Window_Activate, TRUE,
42 WindowContents, VGroup,
43 MUIA_Background, MUII_GroupBack,
44 Child, ListviewObject,
45 MUIA_Listview_List, dirlist = DirlistObject,
46 InputListFrame,
47 End,
48 End,
49 Child, HGroup,
50 Child, str = StringObject,
51 StringFrame,
52 MUIA_String_Contents, (IPTR)"SYS:",
53 End,
54 Child, page = PageGroup,
55 MUIA_Weight, 0,
56 MUIA_FixWidthTxt, (IPTR)"AA",
57 Child, ColorfieldObject,
58 MUIA_Colorfield_Red, 0xFFFFFFFF,
59 MUIA_Colorfield_Green, 0,
60 MUIA_Colorfield_Blue, 0,
61 End,
62 Child, ColorfieldObject,
63 MUIA_Colorfield_Red, 0xFFFFFFFF,
64 MUIA_Colorfield_Green, 0xFFFFFFFF,
65 MUIA_Colorfield_Blue, 0,
66 End,
67 Child, ColorfieldObject,
68 MUIA_Colorfield_Red, 0,
69 MUIA_Colorfield_Green, 0x66666666,
70 MUIA_Colorfield_Blue, 0,
71 End,
72 End,
73 End,
74 End,
75 End,
76 End;
78 if (app)
80 ULONG sigs = 0;
82 DoMethod
84 wnd, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, (IPTR) app,
85 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit
88 DoMethod(str, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime,
89 (IPTR)dirlist, 3, MUIM_Set, MUIA_Dirlist_Directory, MUIV_TriggerValue);
91 DoMethod(dirlist, MUIM_Notify, MUIA_Dirlist_Status, MUIV_EveryTime,
92 (IPTR)page, 3, MUIM_Set, MUIA_Group_ActivePage, MUIV_TriggerValue);
94 set(dirlist, MUIA_Dirlist_Directory, "SYS:");
96 set(wnd,MUIA_Window_Open,TRUE);
98 while (DoMethod(app, MUIM_Application_NewInput, (IPTR) &sigs) != MUIV_Application_ReturnID_Quit)
100 if (sigs)
102 sigs = Wait(sigs | SIGBREAKF_CTRL_C | SIGBREAKF_CTRL_D);
103 if (sigs & SIGBREAKF_CTRL_C) break;
104 if (sigs & SIGBREAKF_CTRL_D) break;
108 MUI_DisposeObject(app);
111 CloseLibrary(MUIMasterBase);
113 return 0;