home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / opengl / xlib / README.pup < prev    next >
Encoding:
Text File  |  1994-08-02  |  5.8 KB  |  146 lines

  1.  
  2.            ~4Dgifts/toolbox/src/exampleCode/opengl/xlib README.pup
  3.  
  4.  
  5.    The code in pup.c and pup.h was ripped out of glws, shredded a bit, and 
  6.    reassembled for opengl usage.  Its pure X code and as such has 2 new 
  7.    parameters in defpup() and newpup() (dpy and screen), but otherwise is 
  8.    identical to the IrisGL version (except it doesn't understand the 
  9.    GLresources).  The code is not pretty.  Beats using some bloato toolkit, 
  10.    though for now, things are still a bit beefy....
  11.  
  12.  
  13.  
  14.    long newpup(Display *dpy, int screen)
  15.    void addtopup(long pup, char *str, ...)
  16.    long defpup(Display *dpy, int screen, char *str, ...)
  17.    long dopup(long menu)
  18.    void freepup(long menu)
  19.    void setpup(long menu, long item, unsigned long arg)
  20.  
  21.  
  22.  
  23.  
  24.  
  25.    long newpup(Display *dpy, int screen)
  26.  
  27.      dpy     pointer to display one is rendering to
  28.  
  29.      screen  screen number (usually 0) one is rendering to
  30.  
  31.  
  32.    ------------------------------------------------------------------------
  33.  
  34.  
  35.    void addtopup(long pup, char *str, ...)
  36.  
  37.      pup      expects the menu identifier of the menu to which you want to
  38.               add. The menu identifier is the returned function value of the
  39.               menu creation call to either newpup or defpup functions.
  40.  
  41.      str      expects a pointer to the text that you want to add as a menu
  42.               item. In addition, you have the option of pairing an "item type"
  43.               flag with each menu item. There are seven menu item type flags:
  44.  
  45.               %t   marks item text as the menu title string.
  46.  
  47.               %F   invokes a routine for every selection from this menu except
  48.                    those marked with a %n.  You must specify the invoked
  49.                    routine in the arg parameter.  The value of the menu item
  50.                    is used as a parameter of the executed routine.  Thus, if
  51.                    you select the third menu item, the system passes 3 as a
  52.                    parameter to the function specified by %F.
  53.  
  54.               %f   invokes a routine when this particular menu item is
  55.                    selected.  You must specify the invoked routine in the arg
  56.                    parameter. The value of the menu item is passed as a
  57.                    parameter of the routine.  Thus, if you select the third
  58.                    menu item, the system passes 3 as a parameter to the
  59.                    routine specified by %f.  If you have also used the %F flag
  60.                    within this menu, then the result of the %f routine is
  61.                    passed as a parameter of the %F routine.
  62.  
  63.               %l   adds a line under the current entry.  You can use this as a
  64.                    visual cue to group like entries together.
  65.  
  66.               %m   pops up a menu whenever this menu item is selected. You
  67.                    must provide the menu identifier of the new menu in the arg
  68.                    parameter.
  69.  
  70.               %n   like %f, this flag invokes a routine when the user selects
  71.                    this menu item.  However, %n differs from %f in that it
  72.                    ignores the routine (if any) specified by %F. The value of
  73.                    the menu item is passed as a parameter of the executed
  74.                    routine.  Thus, if you select the third menu item, the
  75.                    system passes 3 as a parameter to the function specified by
  76.                    %f.
  77.  
  78.               %xn  assigns a numeric value to this menu item.  This values
  79.                    overrides the default position-based value assigned to this
  80.                    menu item (e.g., the third item is 3).  You must enter the
  81.                    numeric value as the n part of the text string.  Do not use
  82.  
  83.  
  84.    ------------------------------------------------------------------------
  85.  
  86.  
  87.    long defpup(Display *dpy, int screen, char *str, ...)
  88.  
  89.      dpy     pointer to display one is rendering to
  90.      
  91.      screen  screen number (usually 0) one is rendering to
  92.  
  93.      str    expects a pointer to the text that you want to add as a menu item.
  94.             In addition, you have the option of pairing an ``item type'' flag
  95.             with each menu item. There are seven menu item type identical to
  96.             the ones enumerated above in addtopup.
  97.  
  98.  
  99.    ------------------------------------------------------------------------
  100.  
  101.  
  102.    long dopup(long menu)
  103.  
  104.      menu    expects the identifier of the pop-up menu you want to display.
  105.  
  106.  
  107.    ------------------------------------------------------------------------
  108.  
  109.  
  110.    void freepup(long menu)
  111.  
  112.      menu    expects the menu identifier of the pop-up menu that you want 
  113.              to deallocate.
  114.  
  115.  
  116.    ------------------------------------------------------------------------
  117.  
  118.  
  119.    void setpup(long menu, long item, unsigned long arg)
  120.  
  121.      menu    expects the menu identifier of the menu whose entries you want to
  122.              change. The menu identifier is the returned function value of the
  123.              menu creation call to either newpup or defpup.
  124.  
  125.      item    expects the position of the item in the menu, indexed from 1.
  126.  
  127.      arg     expects a symbolic constant that indicates the display
  128.              characteristics you want to apply to the chosen entry.  You can
  129.              specify more than one at a time by adding or logically or-ing
  130.              these values together.  For this parameter there are four defined
  131.              symbolic constants:
  132.  
  133.              PUP_NONE, no special display characteristics, fully functional if
  134.              selected.  This is the default mode for newly created menu
  135.              entries.
  136.  
  137.              PUP_GREY, entry is greyed-out and disabled.  Selecting a greyed-
  138.              out entry has the same behavior as selecting the title bar.  If
  139.              the greyed-out entry has a submenu associated with it, that
  140.              submenu does not display.
  141.  
  142.              PUP_BOX Entry has an empty box to the left.
  143.  
  144.              PUP_CHECK Entry has a checked box to the left.
  145.  
  146.