home *** CD-ROM | disk | FTP | other *** search
-
- #include "ListBox.h"
-
- void INIT(unsigned char i)
- {
- InitGraf(&qd.thePort);
- InitFonts();
- InitWindows();
- InitMenus();
- TEInit();
- InitDialogs(nil);
- InitCursor();
- FlushEvents(everyEvent,0);
- MaxApplZone();
- while (i--)
- MoreMasters();
- }
-
-
-
- void main (void) {
- DialogPtr theDialog;
- short itemHit, returnVal;
-
- INIT(3);
-
- theDialog = GetNewDialog(128, nil, (WindowPtr)-1);
- SetPort(theDialog);
-
- ListBox myList;
-
- myList.SetupFromItem(theDialog, 2);
-
- myList.AddItem(1, "\pHi there!!!"); //Line 0, id 1
- myList.AddItem(3, "\pThis Is ListBox."); //Line 1, id 3
- myList.AddItem(5, "\pFor the MacOS ListManager... You got a problem with that?"); //Line 2, id 5
- myList.AddItem(7, "\pAn ease to use replacement..."); //Line 3, id 7
- myList.AddItem(11, "\pby Kyle Ellrott"); //Line 4, id 11
- myList.AddItem(13, "\pKyle Ellrott is a dork"); //Line 5, id 13
-
- myList.KillLine(5);
- myList.SwapLines(2,3);
-
- myList.AddItem(6, "\p");
- myList.AddItem(7, "\pThe following are resources");
- myList.MakeResTypeList('Test');
-
- do {
- myList.ModalDialog(nil, &itemHit);
- } while (itemHit != 1);
-
- returnVal = myList.GetCurItem();
-
- myList.Close();
- CloseWindow(theDialog);
-
- }