home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / doc / Xaw / CH4.intro < prev    next >
Encoding:
Text File  |  1989-12-21  |  3.2 KB  |  88 lines

  1. .bp
  2. \&
  3. .sp 1
  4. .ce 3
  5. \s+1\fBChapter 4\fP\s-1
  6.  
  7. \s+1\fBMenus\fP\s-1
  8. .sp 2
  9. .nr H1 4
  10. .nr H2 0
  11. .nr H3 0
  12. .nr H4 0
  13. .nr H5 0
  14. .na
  15. .LP
  16. .XS
  17. Chapter 4 - Menus
  18. .XE
  19. .IN "Menus" ""
  20. .LP
  21. The Athena widget set provides support for single paned non-hierarchical
  22. popup and pulldown menus.  Since menus are such a common user interface
  23. tool, support for them must be provided in even the most basic widget
  24. sets.  Since the resources available for this task were limited, it was
  25. decided that the Athena widget set would provide only the basic
  26. functionality, and deliberately did not attempt to solve the entire
  27. problem.
  28. .LP
  29. Menus in the Athena widget set are implemented as a Menu container (the
  30. SimpleMenu widget) and a collection of objects that will comprise the
  31. menu entries.  The SimpleMenu widget is itself a direct subclass of the
  32. OverrideShell widget class, therefore no other shell is necessary when
  33. creating a menu.  The managed children of a SimpleMenu must be
  34. subclasses of the Sme (Simple Menu Entry) object.
  35. .LP
  36. The Athena widget set provides three classes of Sme objects that may be
  37. used to build menus.
  38. .sp
  39. .IP \fBSme\fP 1i
  40. .IN "Sme object" "
  41. The base class of all menu entries.  It may be used as a menu entry
  42. itself to provide blank space in a menu.
  43. .IP \fBSmeBSB\fP 1i
  44. .IN "SmeBSB object" ""
  45. This menu entry provides a selectable entry containing a text string.
  46. Support is also provided that allows a bitmap to be placed in the
  47. left and right margins.
  48. .IP \fBSmeLine\fP 1i
  49. .IN "SmeLine object" ""
  50. This menu entry provides an unselectable entry containing a separator line.
  51. .sp
  52. .LP
  53. The SimpleMenu widget informs the window manager that it should ignore
  54. its window by setting the \fBOverride Redirect\fP flag.  This is the
  55. correct behavior for the click-drag-release style of menu operation.  If
  56. click-move-click or \fIpinable\fP menus are desired it is the
  57. responsibility of the application programmer, using the SimpleMenu
  58. resources, to inform the window manager of the menu.
  59. .LP
  60. To allow easy creation of pulldown menus, a MenuButton widget is
  61. also provided as part of the Athena widget set.
  62. .NH 2
  63. Using the Menus
  64. .XS
  65.     Using the Menus
  66. .XE
  67. .IN "Menus" "using"
  68. .LP
  69. The default configuration for the menus is click-move-release, and it is
  70. this interface that I will describe.  The menus will typically be
  71. activated by clicking a pointer button while the pointer is over a
  72. MenuButton, causing the menu to appear in a fixed location relative to
  73. that button; this is a \fBpulldown\fP menu.  Menus may also be activated
  74. .IN "Menus" "pulldown"
  75. when a specific pointer and key sequence is used anywhere in the
  76. application; this is a \fBpopup\fP menu (e.g. clicking Ctrl-<pointer
  77. .IN "Menus" "popup"
  78. button 1> in xterm).  In this case the menu will position itself under
  79. the cursor. Typically menus will be placed so the pointer cursor is on
  80. the first menu entry, or the last entry selected by the user.
  81. .LP
  82. The menu will remain on the screen as long as the pointer button is held
  83. down.  Moving the pointer will highlight different menu items.
  84. If the pointer leaves the menu, or moves over an entry that cannot
  85. be selected then no menu entry will highlighted.  When the desired menu
  86. entry has been highlighted, release the pointer button to remove the menu,
  87. and cause the action associated with this entry to be invoked.
  88.