This should solve an error which made the nightly build fail with:
[AROS-Contrib.git] / bgui / test / test4.c
blob0c9f7f7cb30b55c5f030bb81ffcf04d52ea75852
1 /*
2 ** Test 4.c
3 **
4 ** GUI-Source. Created with BGUIBuilder V1.0
5 */
7 #ifndef LIBRARIES_BGUI_H
8 #include <libraries/bgui.h>
9 #endif
11 #ifndef LIBRARIES_BGUI_MACROS_H
12 #include <libraries/bgui_macros.h>
13 #endif
15 #ifndef BGUI_PROTO_H
16 #include <proto/bgui.h>
17 #endif
19 #include <proto/intuition.h>
20 #include <proto/exec.h>
21 #include <gadgets/gradientslider.h>
23 #include <stdio.h>
25 struct Library *BGUIBase=NULL;
26 struct IntuitionBase * IntuitionBase;
28 enum
30 WIN4_MASTER, WIN4_GRSLIDER1,
32 WIN4_NUMGADS
35 Object *Test_4Objs[WIN4_NUMGADS];
38 ** Ensure correct operation on ECS.
39 **/
40 #define GRADCOLORS 4
42 static WORD penns[ GRADCOLORS + 1 ] =
44 1,2,3,~0
47 Object *InitTest_4( void )
49 Object *win;
50 Object **ar = Test_4Objs;
52 win = WindowObject,
53 WINDOW_SmartRefresh, TRUE,
54 WINDOW_AutoAspect, TRUE,
55 WINDOW_MasterGroup, ar[WIN4_MASTER] = VGroupObject,
56 FRM_Type,FRTYPE_NEXT,
57 FRM_Title,NULL,
58 StartMember, ar[WIN4_GRSLIDER1]= ExternalObject,
59 EXT_MinWidth, 10,
60 EXT_MinHeight, 10,
61 EXT_ClassID, "gradientslider.gadget",
62 EXT_NoRebuild, TRUE,
63 GRAD_PenArray, penns,
64 PGA_Freedom, LORIENT_VERT,
65 GA_ID, WIN4_GRSLIDER1,
66 EndObject,
67 EndMember,
68 EndObject,
69 EndObject;
71 return( win );
74 int main(argc,argv)
76 Object *window;
77 struct Library *GradientSliderBase;
79 if (NULL == (IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library",0)))
81 printf("Could not open Intuition.library!\n");
82 return -1;
85 if(BGUIBase=OpenLibrary(BGUINAME,BGUIVERSION))
87 printf("trying to open gradientslider.gadget\n");
88 if(GradientSliderBase=OpenLibrary("Gadgets/gradientslider.gadget",39L))
90 printf("opened gradientslider.gadget\n");
91 if((window=InitTest_4())!=NULL
92 && WindowOpen(window)!=NULL)
94 ULONG signal;
96 if(GetAttr(WINDOW_SigMask,window,&signal)
97 && signal!=0)
99 for(;;)
101 Wait(signal);
102 switch(HandleEvent(window))
104 case WMHI_CLOSEWINDOW:
105 break;
106 case WMHI_NOMORE:
107 default:
108 continue;
110 break;
113 DisposeObject(window);
115 CloseLibrary(GradientSliderBase);
117 CloseLibrary(BGUIBase);
120 CloseLibrary((struct Library *)IntuitionBase);