1 #include <intuition/intuition.h>
2 #include <proto/exec.h>
4 #include <proto/intuition.h>
5 #include <proto/alib.h>
9 struct IntuitionBase
*IntuitionBase
;
11 static struct EasyStruct es
;
17 LONG result
, counter
= 0;
19 if ((IntuitionBase
= (struct IntuitionBase
*)OpenLibrary("intuition.library",39)))
22 es
.es_StructSize
= sizeof(es
);
25 es
.es_Title
= "First Requester";
26 es
.es_TextFormat
= "I'm a very nice requester :)";
27 es
.es_GadgetFormat
= "Yep!";
29 EasyRequestArgs(0, &es
, 0, 0);
31 es
.es_Title
= "Second Requester";
32 es
.es_TextFormat
= "This requester should have\ntwo text lines!";
33 es
.es_GadgetFormat
= "Ok|Cancel";
35 result
= EasyRequestArgs(0, &es
, 0, 0);
36 puts((result
== 1) ? "You clicked on \"OK\"." : "You clicked on \"Cancel\".");
38 es
.es_Title
= "Third Requester";
39 es
.es_TextFormat
= "One\nTwo\nThree\nFour\n\nTest Test";
40 es
.es_GadgetFormat
= "10|20|30|40|50|60|70|80|90|100";
42 result
= EasyRequestArgs(0, &es
, 0, 0);
43 printf("Result %ld\n",(long)result
);
45 es
.es_Title
= "Fourth Requester";
46 es
.es_TextFormat
= "Requester Text with args:\n\nArg 1: %ld Arg 2: %ld Arg 3: %ld\nStringarg: %s";
47 es
.es_GadgetFormat
= "Coooool";
49 EasyRequest(0, &es
, 0, 10, 20, 30, (IPTR
)"I'm the string");
51 es
.es_Title
= "Fifth Requester";
52 es
.es_TextFormat
= "Requester Text with text and gadget args:\n\nArg 1: %ld Arg 2: %ld Arg 3: %ld\nStringarg: %s";
53 es
.es_GadgetFormat
= "Coooool %ld|Holy %s";
55 EasyRequest(0, &es
, 0, 10, 20, 30, (IPTR
)"I'm the string", 7777, "crap");
57 es
.es_Title
= "Sixth Requester";
58 es
.es_TextFormat
= "I'm an asynchronous Requester.\nWatch shell output while\nrequester is open!";
59 es
.es_GadgetFormat
= "Incredible|Great|Not bad";
61 req
= BuildEasyRequestArgs(0, &es
, 0, 0);
62 if (req
&& (req
!= (struct Window
*)1))
67 result
= SysReqHandler(req
, 0, FALSE
);
68 printf("*** Async Counter: %ld ***\n",(long)++counter
);
70 } while (result
== -2);
72 printf("You clicked on \"%s\"\n",(result
== 1) ? "Incredible" : (result
== 2) ? "Great" : "Not bad");
76 CloseLibrary((struct Library
*)IntuitionBase
);
80 fprintf(stderr
, "Could not open intuition.library V39 or greater.\n");