home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / demos / xgc / Written / Widget < prev    next >
Encoding:
Text File  |  1988-06-15  |  997 b   |  27 lines

  1. What we need is a widget which presents a collection of buttons.  The user
  2. can select only one of them at a time.  When one is selected, its 
  3. foreground and background colors should be reversed and stay that way
  4. until another one is selected.  Exactly one button can be selected at
  5. any one time.
  6.  
  7. Possible implementations:
  8.  
  9. 1.  As a new kind of widget.  bleah.
  10.  
  11.  
  12. 2.  Box surrounding a lot of command buttons.  The command buttons have
  13.     the appropriate callbacks.
  14.  
  15. Callbacks:  a) set all buttons to normal colors
  16.             b) set this button to reverse colors
  17.             c) change the appropriate variable to the desired value.
  18.  
  19.     This can all be done at the time of creation, thus the buttons would
  20.     be invisible to the rest of the program (a good thing).
  21.  
  22.  
  23.  
  24. (2) would be a heck of a lot easier to program, since creating widgets is
  25. a bitch.  However, (1) could come in handy outside of this program.  Perhaps
  26. write it using (2) and switch to (1) if/when we can get the widget working.
  27.