home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gwm18a.zip / data / em-drop-menus.gwm < prev    next >
Lisp/Scheme  |  1995-07-03  |  4KB  |  168 lines

  1. ; DECORATIONS FOR EPOCH
  2. ; =====================
  3.  
  4. ;;File: epoch.gwm -- window decorations for epoch
  5. ;;Heritage: simple-win.gwm
  6.  
  7. ;;Author: Brian L. Kahn   blk@security.mitre.org 
  8. ;;Not for sale or resale, distribution unlimited
  9.  
  10.  
  11. ;; the Dmenu: function creates a named drop-down menu with N items
  12. ;; arguments are the GWM name, menu name string, and a list of items
  13. ;; each item has an item name string and a GWM or elisp command
  14. ;;  Dmenu.exec is an example of a GWM command
  15. ;;  elisp commands are in quotes, and are sent to the window
  16.  
  17.  
  18. (Dmenu: Dmenu.exec
  19.     '("exec" 
  20.       (("execute cut buffer" (execute-string (+ "(? " cut-buffer ")")))
  21.        )))
  22.  
  23.  
  24. (Dmenu: Dmenu.db
  25.    '("db" 
  26.      (("toggle debug" "(setq debug-on-error (not debug-on-error))")
  27.       ("debug on" "(setq debug-on-error t)")
  28.       ("debug off" "(setq debug-on-error f)")
  29.       )))
  30.  
  31. (Dmenu: Dmenu.files
  32.    '("files"
  33.      (("open files" "(buffer-menu-sized)")
  34.       ("directory" "(dired default-directory)")
  35.       ("elisp lib" "(dired (expand-file-name "~/lib/emacs"))")
  36.       )))
  37.  
  38. (Dmenu: Dmenu.buffers 
  39.    '("buffers"
  40.      (("other buffer" "(switch-to-buffer (other-buffer))")
  41.       ("*scratch* buffer" "(switch-to-buffer \"*scratch*\")")
  42.       ("-" (bell))
  43.       ("kill buffer" "(kill-buffer (current-buffer))")
  44.       )))
  45.  
  46. (Dmenu: Dmenu.windows 
  47.    '("windows"
  48.      (("one window" "(delete-other-windows)")
  49.       ("split screen" "(split-window-vertically)")
  50.       )))
  51.  
  52. (Dmenu: Dmenu.screens 
  53.    '("screens"
  54.      (("new screen" "(epoch:create-screen-offset 18)")
  55.       ("delete screen" "(delete-screen)")
  56.       ("name screen" "(epoch::icon-name (buffer-name))")
  57.       )))
  58.  
  59. (Dmenu: Dmenu.fonts
  60.    '("fonts"
  61.      (("screen-14" "(progn (font \"screen.r.14\") (redraw-display))")
  62.       ("screen-11" "(progn (font \"screen.r.11\") (redraw-display))")
  63.       ("screen-7" "(progn (font \"screen.r.7\") (redraw-display))")
  64.       ("serif-16" "(progn (font \"serif.r.16\") (redraw-display))")
  65.       ("misc-15" "(progn (font \"-misc*medium*-15-*\") (redraw-display))")
  66.       ("misc-15-bold" "(progn (font \"-misc*bold*-15-*\") (redraw-display))")
  67.       ("misc-20-bold" "(progn (font \"-misc*bold*-20-*\") (redraw-display))")
  68.       ("courier-20" "(progn (font \"-*-courier-medium-r-*-20-*\") (redraw-display))")
  69.       )))
  70.  
  71. (Dmenu: Dmenu.mail 
  72.    '("mail"
  73.      (("read mail" "(mh-rmail)")
  74.       ("send mail" "(mh-smail)")
  75.       )))
  76.  
  77. (Dmenu: Dmenu.info
  78.     '("info" (("info & help" "(info)"))))
  79.  
  80. (Dmenu: Dmenu.news
  81.     '("news" (("usenet news" "(gnus)"))))
  82.  
  83. (Dmenu: Dmenu.shell
  84.     '("shell" (("csh" "(progn (csh) (end-of-buffer))"))))
  85.  
  86. (Dmenu: Dmenu.space
  87.     '(" " 
  88.       (("redisplay" "(redraw-display)")
  89.        )))
  90.  
  91.  
  92.  
  93.  
  94. ;; a little box with the hostname in it
  95. (: Dmenu.HOST
  96.    '(with (background black foreground white fsm ())
  97.       (plug-make (label-make hostname widget.font))))
  98.  
  99. ;; an empty white box, for use as a separator
  100. (: Dmenu.BOX
  101.    '(with (background black foreground white fsm ())
  102.       (plug-make (label-make "  " widget.font))))
  103.  
  104.  
  105.  
  106.  
  107.  
  108. ;; A menu bar is made from a list of drop-down menus, like this:
  109. ;; (window-make (widget:Dmenubar-make Dmenu.epoch-menus) () () () () ))
  110.  
  111. (: Dmenu.epoch-menus
  112.    (list 
  113.     Dmenu.db
  114.     Dmenu.fonts
  115.     Dmenu.exec
  116.     Dmenu.space
  117.     Dmenu.files
  118.     Dmenu.buffers
  119.     Dmenu.windows
  120.     Dmenu.screens
  121.     Dmenu.space
  122.     Dmenu.mail
  123.     Dmenu.info
  124.     Dmenu.news
  125.     Dmenu.shell
  126.     Dmenu.db
  127.     ))
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134. ;; File:  style.gwm -- window styles for epoch, santt
  135.  
  136. ;;Author: Brian L. Kahn
  137. ;;Not for sale or resale, distribution unlimited
  138.  
  139.  
  140. (df style:epoch ()
  141.     (window-make (widget:Dmenubar-make Dmenu.epoch-menus)
  142.          widget:scrollbar-make () () () ))
  143.  
  144.  
  145.  
  146. (df style:minibuf ()
  147.     (window-make ()()()()()))
  148.  
  149. (df style:pop ()
  150.     (window-make ()()()()()))
  151.  
  152.  
  153.  
  154. (df style:select ()
  155.     '(or (# (atom (or (get-x-property "style")
  156.               (window-client-name)))
  157.         (list 'epoch (style:epoch)
  158.           'minibuf (style:minibuf)
  159.           'pop (style:pop)
  160.           ))
  161.      (style:epoch))
  162.     )
  163.  
  164.  
  165.  
  166. (set-window Epoch style:select)
  167.  
  168.