revert between 56095 -> 55830 in arch
[AROS.git] / workbench / demos / rtlong.c
blob5ebd32fb2bd8a94b68d4b18b4bc76ebfcc14377f
2 #include <libraries/reqtools.h>
3 #include <proto/exec.h>
4 #include <proto/reqtools.h>
6 #include <stdio.h>
7 #include <string.h>
8 #include <stdlib.h>
10 #define PROGNAME "rtlong"
12 struct ReqToolsBase *ReqToolsBase;
14 static void cleanup(char *msg)
16 if (msg) printf(PROGNAME ": %s\n", msg);
18 if (ReqToolsBase) CloseLibrary((struct Library *)ReqToolsBase);
20 exit(0);
23 static void openlibs(void)
25 ReqToolsBase = (struct ReqToolsBase *)OpenLibrary("reqtools.library", 0);
26 if (!ReqToolsBase) cleanup("Can't open reqtools.library");
29 static void action(void)
31 struct TagItem tags[] =
33 {RT_Underscore , (IPTR)'_' },
34 {RTGL_Min , -100 },
35 {RTGL_Max , 100 },
36 {RTGL_Flags , GLREQF_CENTERTEXT },
37 {RTGS_TextFmt , (IPTR)"Enter something\n12345678\nABCDEF" },
38 {RTGS_GadFmt , (IPTR)"O_k|Hel_lo|_Something" },
39 {TAG_DONE }
41 LONG val = 0;
43 rtGetLongA((ULONG *)&val, "Title", NULL, tags);
46 int main(void)
48 openlibs();
49 action();
50 cleanup(0);
52 return 0;