home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga Shareware Floppies / ma21.dms / ma21.adf / MUIBuilder / examplessource / c / Small.c < prev    next >
C/C++ Source or Header  |  1980-03-18  |  2KB  |  78 lines

  1. #include "code.h"
  2.  
  3. int main()
  4. {
  5.     ULONG    signal;
  6.     BOOL    running = TRUE;
  7.     APTR    app, WI_smallexample, LV_label_0, LV_label_1, BT_ok, BT_cancel;
  8.  
  9.     init();
  10.  
  11.  
  12.     app = ApplicationObject,
  13.         MUIA_Application_Author, "Eric Totel",
  14.         MUIA_Application_Base, "SMALL",
  15.         MUIA_Application_Title, "Small Example",
  16.         MUIA_Application_Version, "1.0",
  17.         MUIA_Application_Copyright, "(c) 1993 Eric Totel",
  18.         MUIA_Application_Description, "Here is a small example of MUI-Builder",
  19.         MUIA_HelpFile, "/ExamplesDoc/small.guide",
  20.         SubWindow, WI_smallexample = WindowObject,
  21.             MUIA_Window_Title, "Small example",
  22.             MUIA_HelpNode, "WI_smallexample",
  23.             WindowContents, GroupObject,
  24.                 Child, GroupObject,
  25.                     GroupFrameT( "two lists" ),
  26.                     MUIA_Group_Horiz, 1,
  27.                     Child, LV_label_0 = ListviewObject,
  28.                         MUIA_Listview_List, DirlistObject,
  29.                             MUIA_Dirlist_Directory, "progdir:",
  30.                             MUIA_Dirlist_DrawersOnly, 0,
  31.                             MUIA_Dirlist_FilesOnly, 0,
  32.                             MUIA_Dirlist_FilterDrawers, 0,
  33.                             MUIA_Dirlist_MultiSelDirs, 0,
  34.                             MUIA_Dirlist_RejectIcons, 0,
  35.                             MUIA_Dirlist_SortDirs, MUIV_Dirlist_SortDirs_First,
  36.                             MUIA_Dirlist_SortHighLow, 0,
  37.                             MUIA_Dirlist_SortType, 0,
  38.                             End,
  39.                         End,
  40.                     Child, LV_label_1 = ListviewObject,
  41.                         MUIA_Listview_List, VolumelistObject,
  42.                             InputListFrame,
  43.                             End,
  44.                         End,
  45.                     End,
  46.                 Child, GroupObject,
  47.                     MUIA_Group_Horiz, 1,
  48.                     MUIA_Group_SameWidth, 1,
  49.                     Child, BT_ok = KeyButton( "OK",'o' ),
  50.                     Child, BT_cancel = KeyButton( "Cancel",'c' ),
  51.                     End,
  52.                 End,
  53.             End,
  54.         End;
  55.  
  56.     /* Notify : clicking buttons => OUT */
  57.     DoMethod( BT_ok, MUIM_Notify, MUIA_Pressed, FALSE, app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
  58.     DoMethod( BT_cancel, MUIM_Notify, MUIA_Pressed, FALSE, app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
  59.  
  60.     /* Notify : close gadget => end of application */
  61.     DoMethod( WI_smallexample, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit );
  62.  
  63.     /* Open the window */
  64.     set ( WI_smallexample, MUIA_Window_Open, TRUE );
  65.  
  66.     while (running)
  67.     {
  68.         switch (DoMethod(app,MUIM_Application_Input,&signal))
  69.         {
  70.         case MUIV_Application_ReturnID_Quit:
  71.             running = FALSE;
  72.             break;
  73.         }
  74.         if (signal) Wait(signal);
  75.     }
  76.     MUI_DisposeObject(app);
  77. }
  78.