home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / desklib / Examples / Pane < prev    next >
Encoding:
Text File  |  1994-02-05  |  1.4 KB  |  41 lines

  1. /*
  2.  * Snippets of example code to accompany the Pane sublibrary
  3.  * This example routine might be called when the user selects 'Options...' from
  4.  * your menu.
  5.  */
  6.  
  7. #include "DeskLib:Pane.h"
  8.  
  9.  
  10. /* Global structure to hold pane data */
  11.  
  12. static pane_data optionspanedata;
  13.  
  14.  
  15. static void MenuSel_Options()
  16. {
  17.   window_handle    main, pane;
  18.   void            *temp;
  19.  
  20.   main = Window_Create("Options", 0);         /* Create windows */
  21.   pane = Window_Create("OptionPane", 0);      /* 'Options' probably has Save, */
  22.                                               /* Cancel, Quit icons and a     */
  23.                                               /* lowered icon the size of     */
  24.                                               /* 'OptionsPane', which has all */
  25.                                               /* the options details in it    */
  26.  
  27.   Pane_InitData(main, pane, &optionspanedata);  /* Initialise data */
  28.   Pane_Open(optionspanedata);                   /* Open them both  */
  29.  
  30.   temp = (void *)&optionspanedata;              /* Just to make the next 2 lines
  31.                                                    neater */
  32.  
  33.   Event_Claim(event_OPEN, main, event_ANY, Pane_OpenEvent, temp);
  34.  
  35.                                 /* Only need to attach to main window
  36.                                    although you can attach to both if you think
  37.                                    that your program might close the pane. */
  38.  
  39.   Event_Claim(event_CLOSE, main, event_ANY, Pane_Delete, temp);
  40. }
  41.