home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gwm18a.zip / data / drop-menus.doc < prev    next >
Internet Message Format  |  1995-07-03  |  4KB

  1. From: blk@vanity.mitre.org (Brian L. Kahn)
  2. Subject: Drop menus, scrollbars .shar file
  3. Date: Tue, 19 May 92 12:58:56 EDT
  4.  
  5.  These WOOL and elisp files implement a flexible and useful approach
  6. to drop down menus and scrollbars for epoch under GWM.  This README
  7. file is not adequate documentation, but unfortunately this is all you
  8. get.  If things don't work, try looking through the code.
  9.  
  10.  These are the files included:
  11.  drop-menus.gwm    - definition of some drop down menus
  12.  style.gwm         - example of a drop-menus bar in a style
  13.  widgets.gwm       - all the code implementing drop-menus and scrollbars
  14.  widgets.el        - the epoch code that interprets events from GWM
  15.  
  16.  The files should be loaded in this order:  widgets, drop-menus, style.
  17.  
  18.  
  19.  
  20. HOW IT LOOKS
  21. ------------
  22.  The drop-menus are part of a window decoration style.  Normally an
  23. Xwindow class or program name will have the same decoration, altho you
  24. can fiddle with that.  Style.gwm shows how to select the decoration
  25. based on any old characteristic you wish.  I used that to give a
  26. different decoration to epoch windows I refered to as popups, little
  27. information type windows not meant for editing.  Simple usage gives
  28. the same decoration to all your epoch windows except the minibuffer.
  29.  
  30.  The drop-down menus are collected into a menubar, a bar with bunch of
  31. little buttons in them which drop down menus.  A quick click/release
  32. selects the first thing on the menu.
  33.  
  34.  I suggest putting this bar on top, because the code does drop-down
  35. menus.  If you don't like sacrificing your title bar, try changing the
  36. code to make jump-up menus and put it at the bottom!
  37.  
  38. The scrollbar doesn't have any slider.  A slider seems to be a lot of
  39. effort for little payoff.  The scrollbar doesn't visually split when
  40. the epoch screens split, but epoch interprets events on a per-window
  41. basis.  This lets you scroll the other window very easily, a big
  42. advantage.
  43.      
  44.  
  45.  
  46. HOW IT WORKS
  47. ------------
  48.  The WOOL code communicates with epoch by setting the properties
  49. "Dmenu" or "scrollbar" when events occur.  Pushing a couple of
  50. property handlers grabs the messages and deals with them.  The Dmenu
  51. handler just takes the message as a string and executes it.  The
  52. scrollbar handler takes different actions for each of the three
  53. buttons, easily changed by the scrollbar-funcs constant:
  54.  
  55.   (defconst widget:scrollbar-funcs
  56.     '((1 . scroll-up) (2 . line-up-point) (3 . scroll-down)))
  57.  
  58.  If the epoch screen is split into several windows, the scrollbar
  59. handler figures out which window is next to the scrollbar and acts on
  60. that window.  The information sent to epoch by GWM tells how far down
  61. the scrollbar (in percent, 0-100) the mouse click was, so proportional
  62. scrolling through the file should be easy to do.
  63.  
  64.  
  65.  
  66. POSSIBLE PROBLEMS 
  67. ----------------- 
  68.  When the cursor is on a button, the font changes to bold - a nice
  69. effect assuming you have the right fonts.  Note that the fonts I used
  70. have the same width in regular or bold, so the buttons don't shift to
  71. the right when I bold one of them.  I think these fonts are part of
  72. the standard X distribution.
  73.  
  74.  I last used this a long time ago, under earlier versions of GWM and
  75. epoch.  Some around here are still using this stuff, but I can't vouch
  76. for compatability.  Also, I pulled this out as a piece from my larger
  77. set of personal preferences in GWM.  I may have forgotten some little
  78. support function.
  79.  
  80.  
  81.  
  82.  
  83. COPYRIGHT
  84. ---------
  85.  As it says in each file, use as you like but don't try to sell it.
  86. Like anyone would pay for this, right?  This does not prevent you from
  87. including this along with something you *are* selling, as long as the
  88.