home *** CD-ROM | disk | FTP | other *** search
- /*
- Demo - how to attach a menu to a CON: window
-
- JtU-Member
- E. Lenz
-
- All Rights Reserved */
-
- #include <libraries/dos.h>
- #include <intuition/intuition.h>
- #include <intuition/intuitionbase.h>
-
- extern void *OpenLibrary(),*Open();
-
- struct IntuitionBase *IntuitionBase;
- struct FileHandle *conhandle;
-
- char MyCon[]="CON:0/0/600/200/CON Window";
-
- struct IntuiText Redraw =
- { 0,1, /* frontpen, backpen */
- JAM1, /* drawmode */
- 1,1, /* leftedge, topedge */
- NULL, /* TextAttr */
- (UBYTE *)"Punkt 2", /* IText */
- NULL, /* NextText */
- };
-
- struct MenuItem draw =
- { (struct MenuItem *) NULL,
- 0,10, /* LeftEdge, TopEdge */
- 150,10, /* Width, Height */
- ITEMTEXT | HIGHCOMP | ITEMENABLED, /* Flags */
- 0, /* Mutual Exclude */
- (APTR)&Redraw, /* ItemFill */
- NULL, /* SelectFill */
- 0, /* Command */
- NULL, /* Subitem */
- 0, /* NextSelect */
- };
-
- struct IntuiText Noth =
- { 0,1, /* frontpen, backpen */
- JAM1, /* drawmode */
- 1,1, /* leftedge, topedge */
- NULL, /* TextAttr */
- (UBYTE *)"Punkt 1", /* IText */
- NULL, /* NextText */
- };
-
- struct MenuItem nothing =
- { (struct MenuItem *) &draw,
- 0,0, /* LeftEdge, TopEdge */
- 150,10, /* Width, Height */
- ITEMTEXT | HIGHCOMP | ITEMENABLED, /* Flags */
- 0, /* Mutual Exclude */
- (APTR)&Noth, /* ItemFill */
- NULL, /* SelectFill */
- 0, /* Command */
- NULL, /* Subitem */
- 0, /* NextSelect */
- };
-
- struct Menu menu =
- { (struct Menu *) NULL, /* NEXT menu */
- 0, 0, 150, 0, /* LeftEdge, TopEdge, Width, Height */
- MENUENABLED, /* Flags */
- (BYTE *) "Mein menu", /* MenuName */
- (struct MenuItem *)¬hing, /* First item */
- 0,0,0,0, /* JazzX,JazzY, BeatX, BeatY */
- };
-
- quit()
- { CloseLibrary(IntuitionBase);
- if (conhandle) Close(conhandle);
- exit(0);
- }
-
- main()
- { struct Window *Window;
- int i;
-
- if (!(IntuitionBase=OpenLibrary("intuition.library",NULL))) exit(0);
- if (!(conhandle=Open(MyCon,MODE_OLDFILE))) quit();
- Window=IntuitionBase->ActiveWindow;
- SetMenuStrip(Window, &menu);
-
- Write(conhandle,"\n\2334;32;43mPress <RETURN>\2330;31;40m",33L);
- Read(conhandle,&i,1L);
- quit();
- }
-
-
-
-
-