grub2: bring back build of aros-side grub2 tools
[AROS.git] / test / Zune / listinsertactive.c
blob5c21f38c692a104b17e75ebef80e2681c90e3c9e
1 #include <ctype.h>
2 #include <stdlib.h>
3 #include <stdio.h>
4 #include <string.h>
6 #include <clib/alib_protos.h>
7 #include <exec/exec.h>
8 #include <exec/types.h>
10 #include <libraries/mui.h>
12 #include <proto/dos.h>
13 #include <proto/exec.h>
14 #include <proto/intuition.h>
15 #include <proto/muimaster.h>
16 #include <proto/utility.h>
18 static const char str[] = "\33bTHERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. "
19 "EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDER AND/OR OTHER PARTIES "
20 "PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR "
21 "IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY "
22 "AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE "
23 "OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE "
24 "COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n"
25 "\n"
26 "\33bIN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING "
27 "WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY REDISTRIBUTE THE "
28 "PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY "
29 "GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE "
30 "USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS "
31 "OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR "
32 "THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER "
33 "PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE "
34 "POSSIBILITY OF SUCH DAMAGES.";
36 #define List(ftxt) ListviewObject, MUIA_Weight, 50, MUIA_Listview_Input, FALSE, MUIA_Listview_List,\
37 FloattextObject, MUIA_Frame, MUIV_Frame_ReadList, MUIA_Background, MUII_ReadListBack, MUIA_Floattext_Text, ftxt, MUIA_Floattext_TabSize, 4, MUIA_Floattext_Justify, TRUE, End, End
39 int main(int argc, char *argv[])
41 Object *win, *app, *bt, *lv;
42 ULONG sigs = 0;
43 ULONG id;
45 app = ApplicationObject,
46 MUIA_Application_Title, "Foo",
47 MUIA_Application_Base, "xxxxx",
49 SubWindow, win = WindowObject,
50 MUIA_Window_Title, "Bar",
52 WindowContents, VGroup,
54 Child, VGroup,
56 Child, lv = ListviewObject,
57 MUIA_CycleChain, 1,
58 MUIA_Listview_List,
59 ListObject, InputListFrame, End,
60 End,
61 Child, List(str),
62 Child, bt = SimpleButton("Click me!"),
63 End,
64 End,
65 End,
66 End;
68 DoMethod(win, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
69 DoMethod(bt, MUIM_Notify, MUIA_Pressed, FALSE, app, 2, MUIM_Application_ReturnID, 1);
71 set(win, MUIA_Window_Open, TRUE);
73 while((id = DoMethod(app,MUIM_Application_NewInput,&sigs)) != MUIV_Application_ReturnID_Quit) {
75 if(id == 1) {
77 static const char *foo = "Hello World";
79 DoMethod(lv, MUIM_List_InsertSingle, foo, MUIV_List_Insert_Active);
82 if(sigs) {
83 sigs = Wait(sigs | SIGBREAKF_CTRL_C);
84 if (sigs & SIGBREAKF_CTRL_C) break;
88 MUI_DisposeObject(app);
90 return 0;