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

  1. ; group windows into dvrooms
  2. ;
  3. ;;File: dvrooms.gwm
  4. ;;Author: duanev@mcc.com (Duane Voth)
  5. ;;Revision: 1.5 -- Nov 18 1990
  6. ;
  7. ; History:  1.0 -- Oct 18 1989    original
  8. ;        1.1 -- Oct 26 1989    windows are placed back on the screen (in
  9. ;                iconic form) when a dvroom manager dies
  10. ;        1.2 -- Nov 21 1989    use gwm-quiet
  11. ;        1.3 -- Nov 22 1989  create rmgrs from wool (colas)
  12. ;        1.4 -- May 11 1990  use GWM_ROOM property to remeber room windows
  13. ;        1.5 -- Nov 18 1990  Philippe Kaplan (phk)
  14. ;                act as icon boxes:
  15. ;                  do (setq dvroom.icon-box t) before load
  16. ;                exit bug fixed around line 190
  17. ;
  18. ; dvrooms.gwm must be loaded in the .profile.gwm before any set-window,
  19. ; set-icon-window, set-placement, or set-icon-placement calls.  it should
  20. ; also follow loading of icon-groups.gwm if used.  (this probably isn't
  21. ; necessary but it seems to be programatically correct)
  22. ;
  23. ; to use rooms, the following can be added to your .profile.gwm:
  24. ;
  25. ; (defun screen-startup ()
  26. ;    (setq count-of-windows-on-screen (length (list-of-windows)))
  27. ;    (new-dvroom-manager "home")
  28. ;    (new-dvroom-manager "lisp")
  29. ;    (new-dvroom-manager "wysiwyg")
  30. ;    (dvroom-reattach)
  31. ;    (if (= 0 count-of-windows-on-screen)
  32. ;          (! "/bin/sh" "-c" "$HOME/.xrc")))
  33. ; (setq to-be-done-after-setup (+ to-be-done-after-setup '((screen-startup))))
  34. ;
  35. ; be sure also to attach add-to-dvroom and remove-from-dvroom to some unused
  36. ; mouse button / keyboard modifier combinations.  Example:
  37. ;
  38. ; (: standard-behavior
  39. ;   (state-make
  40. ;         ....
  41. ;       (on (buttonpress 1 with-control) (add-to-room))
  42. ;       (on (buttonpress 3 with-control) (remove-from-room))
  43. ;   ))
  44. ;;=============================================================================
  45. ;;                    1.5
  46. ;;=============================================================================
  47. ; New version of "dvrooms.gwm". Small changes produce big results:
  48. ;  - You may open any number of rooms, instead of only one.
  49. ;  - you can attach a window to several rooms.
  50. ; Be carefull:
  51. ;  - The notion of current-dvroom becomes "the last room openned" (add-to-room
  52. ;  and remove-from-room use current-dvroom).
  53. ; Since it changes the concept of rooms, we'd better speak about "icon boxes".
  54. ; Note that you can again remove and add any window to/from any room, so
  55. ; this is clever than icon-group.gwm.
  56. ;      To enable this feature, put:
  57. ; (setq dvroom.icon-box t)
  58. ;      before
  59. ; (load "dvrooms")
  60. ; Put in your .profile.gwm some lines like:
  61. ; (defun epoch-decos ()
  62. ;   '(if (member "Minibuffer" window-name)
  63. ;        (no-frame)
  64. ;        (progn
  65. ;          (if (and (boundp 'dvroom-managers) (find-dvroom-by-name "epoch"))
  66. ;              (add-to-dvroom-group (find-dvroom-by-name "epoch") (wob))
  67. ;              (set-x-property "GWM_ROOM" "epoch"))
  68. ;          (simple-win))))
  69. ; (set-window Emacs epoch-decos)
  70. ; (set-icon-placement Gwm     rows.top-left.placement) ; set rooms placements
  71. ; (set-placement      Gwm     rows.top-left.placement)
  72. ; So every new epoch screen belongs to "epoch"'s room.
  73.  
  74. ;;=============================================================================
  75. ;;                    code
  76. ;;=============================================================================
  77.  
  78. ; global dvroom variables
  79. (declare-screen-dependent
  80.   dvroom.font
  81.   dvroom.background
  82.   dvroom.foreground
  83. )
  84.  
  85. (setq dvroom-managers ())        ; list of windows for dvroom managers
  86. (setq current-dvroom ())        ; index into dvroom-managers of the current dvroom
  87.  
  88. ; user-settable resources
  89. (for screen (list-of-screens)
  90.   (defaults-to
  91.     dvroom.font (font-make "8x13")
  92.     dvroom.background white
  93.     dvroom.foreground black
  94.   ))
  95.  
  96. (defaults-to
  97.   dvroom.borderwidth borderwidth
  98.   dvroom.auto-add ()            ; new windows added to current room?
  99.   dvroom.icon-box ()            ; act as icon boxes
  100.   dvroom.x 0
  101.   dvroom.y 0
  102.   dvroom.name "Room #"
  103.   dvroom.rootmenupos 5            ; where to place root menu items
  104.   dvroom.menupos 2            ; where to place menu menu items
  105.   edit-keys.return "Return"
  106.   edit-keys.backspace "BackSpace"
  107.   edit-keys.delete "Delete"
  108. )
  109.  
  110. (defaults-to dvroom.name.number 0)
  111.  
  112. ; save current iconify-window function
  113. (if (not (boundp 'pre-dvrooms-iconify-window))
  114.     (setq pre-dvrooms-iconify-window iconify-window))
  115.  
  116. ; add w to the list of windows managed by a dvroom-manager
  117. (defun add-to-dvroom-group (dvroom-manager w)
  118.  (if (not (member w (nth 'rgroup dvroom-manager)))
  119.    (progn
  120.      (with (wob w) (setq window-wm-state-icon
  121.              (with (wob dvroom-manager) window-icon)))
  122.      (replace-nth 'rgroup dvroom-manager (+ (nth 'rgroup dvroom-manager) (list w))))))
  123.  
  124. ; remove w from the list of windows managed by a dvroom-manager
  125. ;; be careful, the window might not exist anymore, if we get called on closing
  126. ;; of an application!
  127.  
  128. (defun remove-from-dvroom-group (dvroom-manager w)
  129.   (if (window-is-valid w)
  130.     (with (wob w) (setq window-wm-state-icon 0))
  131.   )
  132.   (with (slot (member w (nth 'rgroup dvroom-manager)))
  133.     (if slot (delete-nth slot (nth 'rgroup dvroom-manager)))))
  134.  
  135. ; a version of print that honors gwm-quiet
  136. (defun qprint args
  137.   (if (= gwm-quiet 0) (eval (+ '(print) args))))
  138.  
  139.  
  140. ; open all windows in a dvroom
  141. ; assumes "window" is the dvroom manager being opened
  142. (defun open-dvroom ()
  143.     (for window (nth 'rgroup window-window)
  144.     ; map the window if it was mapped, else map the icon
  145.     (if (nth 'rgroup-state window)
  146.         (map-window window)
  147.         (map-window window-icon))))
  148.  
  149.  
  150. ; close all windows in a dvroom
  151. ; assumes "window" is the dvroom manager being closed
  152. (defun close-dvroom ()
  153.     (for window (nth 'rgroup window)
  154.     ; save window state - is it a window or an icon
  155.     (replace-nth 'rgroup-state window window-is-mapped)
  156.     ; remove both windows and icons from the screen
  157.     (if window-is-mapped (unmap-window window))
  158.     (if (window-icon?)
  159.         (with (window window-icon)
  160.           (if window-is-mapped (unmap-window window))))))
  161.  
  162.  
  163. ; redefine iconify-window so we can do dvroom specific stuff
  164. (defun iconify-window ()
  165.     (if (= window-name "rmgr")
  166.     ; (de)iconifing a dvroom manager
  167.     (if (= window-status 'window)
  168.  
  169.         ; iconifing (closing) a dvroom manager
  170.         (progn
  171.         (close-dvroom)
  172.         (if (not dvroom.icon-box)
  173.             (setq current-dvroom ()))
  174.         (pre-dvrooms-iconify-window)
  175.         )
  176.         
  177.         ; deiconifing (opening) a dvroom manager
  178.         (with (rmgr-index (member window-window dvroom-managers))
  179.  
  180.         ; close previous dvroom manager
  181.         (if (and current-dvroom (not dvroom.icon-box))
  182.             (with (window (nth current-dvroom dvroom-managers))
  183.             (if (= window-status 'window)
  184.                 (iconify-window)    ; recurse to close dvroom
  185.             )
  186.             )
  187.         )
  188.  
  189.         (if rmgr-index
  190.             ; existing dvroom manager
  191.             (open-dvroom)
  192.             ; register a new dvroom manager
  193.             (progn
  194.             ; save window-window as the manager may be iconic and
  195.             ; we need a consistent value in the dvroom-mgr list
  196.             (setq dvroom-managers
  197.                 (+ dvroom-managers (list window-window)))
  198.             (setq rmgr-index (member window-window dvroom-managers))
  199.             )
  200.         )
  201.  
  202.         (setq current-dvroom rmgr-index)
  203.         (pre-dvrooms-iconify-window)
  204.         )
  205.     )
  206.  
  207.     ; (de)iconifing other windows
  208.     (progn
  209.         (pre-dvrooms-iconify-window)
  210.     )
  211.     )
  212. )
  213.  
  214.  
  215. (defun dvroom-icon-name (dvroom)
  216.   (with (window dvroom) window-icon-name))
  217.  
  218. (defun find-dvroom-by-name (name)
  219.   (tag room-found
  220.     (for dvroom dvroom-managers
  221.       (if (= name (dvroom-icon-name dvroom))
  222.     (exit room-found dvroom)))))
  223.  
  224. ;; register a new dvroom manager -or- readd a window to a room
  225. ;; (should be called when new windows become known to gwm (ie. via
  226. ;; gwm global opening))
  227. ;; assumes "window" is the new dvroom manager or window
  228.  
  229. (defun add-dvroom-manager ()
  230.   (if (= window-name "rmgr")
  231.     (if (not (member window-window dvroom-managers))
  232.       (progn (qprint "new dvroom manager " window-icon-name "\n")
  233.         ;; save window-window as the manager may be iconic and
  234.         ;; we need a consistent value in the dvroom-mgr list
  235.     (setq dvroom-managers (+ dvroom-managers (list window-window)))))
  236.     ;; else it's not a manager.  see if this window previously belonged to
  237.     ;; a room and add a new manager if the named manager does not exist
  238.  
  239.     (with (room-name (get-x-property "GWM_ROOM"))
  240.       (if (< 0 (length room-name))
  241.     (if (not (find-dvroom-by-name room-name))
  242.       (new-dvroom-manager room-name))))
  243.     () 
  244.  
  245.     ;; if dvroom.auto-add is true, then add to current dvroom if one exists
  246.     (if (and dvroom.auto-add (= (type current-dvroom) 'number))
  247.       (add-to-dvroom))
  248.   )
  249. )
  250.  
  251. ; add add-dvroom-manager to progn of funcs to eval when opening a new window
  252. ; assumes dvroom.gwm is before the set-* calls in .profile.gwm
  253. (setq opening (+ opening '((add-dvroom-manager))))
  254.  
  255.  
  256. ; reattach windows that have a GWM_ROOM property to the room managers
  257.  
  258. (defun dvroom-reattach window-list
  259.   (for window (if window-list window-list (list-of-windows))
  260.     (with (room-name (get-x-property "GWM_ROOM"))
  261.       (if (<  0 (length room-name))
  262.     (for dvroom dvroom-managers
  263.       (if (= room-name (dvroom-icon-name dvroom))
  264.         (progn
  265.           (add-to-dvroom-group dvroom window)
  266.           (if (not (= dvroom current-dvroom))
  267.         (progn
  268.           ; remove both window and icon from the screen
  269.           (if window-is-mapped (unmap-window window))
  270.           (if (window-icon?)
  271.               (with (window window-icon)
  272.                 (if window-is-mapped (unmap-window window))))))
  273.           (qprint "adding   <" window-name ">   to dvroom "
  274.                 (dvroom-icon-name dvroom) "\n"))))))))
  275.  
  276.  
  277. ; add a window to a dvroom
  278. ; assumes "window" is the application window to add
  279. (defun add-to-dvroom ()
  280.     (with (window window-window)
  281.     (if (and (= (type current-dvroom) 'number)
  282.          (not (= window-name "rmgr")))
  283.         (with (dvroom-manager (nth current-dvroom dvroom-managers))
  284.         (if (not (member window (nth 'rgroup dvroom-manager)))
  285.             (progn (add-to-dvroom-group dvroom-manager window)
  286.                (set-x-property "GWM_ROOM"
  287.                 (with (wob dvroom-manager) window-icon-name))
  288.                ; give the user *some* kind of feed back
  289.                (qprint "adding   <" window-name ">   to dvroom "
  290.                 (dvroom-icon-name dvroom-manager) "\n")))))))
  291.  
  292.  
  293. ; remove a window from a dvroom
  294. ; assumes "window" is the application window to remove
  295. (defun remove-from-dvroom ()
  296.     (with (window window-window)
  297.     (if (= (type current-dvroom) 'number)
  298.         (with (dvroom-manager (nth current-dvroom dvroom-managers))
  299.         (if (member window (nth 'rgroup dvroom-manager))
  300.           (progn
  301.             (set-x-property "GWM_ROOM" "")
  302.             ; give the user *some* kind of feed back
  303.             (qprint "removing <" window-name "> from dvroom "
  304.             (dvroom-icon-name dvroom-manager) "\n"))
  305.           (qprint "not a dvroom member\n"))
  306.         (remove-from-dvroom-group dvroom-manager window)))))
  307.  
  308.  
  309. ; if a normal window, remove it from any dvroom manager, but if a dvroom
  310. ; manager and not current, make all of the dvrooms windows visible.
  311. ; (this function needs to be called when an application exits (ie. via gwm
  312. ; global closing) so that gwm won't try to operate on non-existant windows)
  313. ; assumes "window" is the application window that is exiting
  314. (defun flush-dvroom-lists ()
  315.     (for dvroom-manager dvroom-managers
  316.     (remove-from-dvroom-group dvroom-manager window-window))
  317.     (with (index (member window-window dvroom-managers))
  318.     ; if a dvroom manager
  319.     (if index 
  320.         (progn
  321.         (if (= current-dvroom index)
  322.             (setq current-dvroom ())
  323.             (progn
  324.             (open-dvroom)
  325.             (if (> current-dvroom index)
  326.                 (setq current-dvroom (- current-dvroom 1)))))
  327.         (delete-nth index dvroom-managers)))))
  328.  
  329. ; add flush-dvroom-lists to progn of funcs to eval when closing an old window
  330. ; assumes dvroom.gwm is loaded before the set-* calls in .profile.gwm
  331. (setq closing (+ closing '((flush-dvroom-lists))))
  332.  
  333.  
  334. ; colas: create dvroom managers as placed menus
  335. (defun new-dvroom-manager args
  336.   (if (not (find-dvroom-by-name (# 0 args)))
  337.     (with (fsm window-fsm
  338.            background dvroom.background foreground dvroom.foreground
  339.            borderwidth dvroom.borderwidth
  340.            direction vertical
  341.            label-horizontal-margin 4 label-vertical-margin 2
  342.            menu-min-width 30 menu-max-width 1000
  343.            name (if args (# 0 args) (new-dvroom-manager-name))
  344.            )
  345.       (setq wob 
  346.         (with (icon-name name starts-iconic t)
  347.           (place-menu
  348.            'rmgr
  349.            (menu-make
  350.             (bar-make
  351.              (with (fsm dvroom.fsm
  352.                     property (+ (list
  353.             'title name
  354.             'background dvroom.background
  355.             'foreground dvroom.foreground
  356.             'borderwidth dvroom.borderwidth
  357.             'font dvroom.font
  358.               ) property))
  359.                (plug-make
  360.                 (label-make name dvroom.font)))))
  361.            dvroom.x dvroom.y)))
  362.       (## 'title wob name)
  363.       (add-dvroom-manager))))
  364.  
  365.  
  366. ; generates a new dvroom name
  367. (defun new-dvroom-manager-name ()
  368.   (setq dvroom.name.number (+ 1 dvroom.name.number))
  369.   (+ dvroom.name (itoa dvroom.name.number)))
  370.  
  371. ; editable plug fsm
  372.  
  373. (setq dvroom.fsm
  374.   (fsm-make 
  375.     (: dvroom.edit-fsm.normal 
  376.       (state-make
  377.     (on (double-button any any) 
  378.       (progn
  379.         (set-focus wob)
  380.         (wob-background (# 'foreground wob))
  381.         (with (
  382.         foreground (# 'background wob)
  383.         background (# 'foreground wob)
  384.           )
  385.           (wob-tile 
  386.         (active-label-make
  387.           (# 'title wob) (# 'font wob)))))
  388.       dvroom.edit-fsm.editable)
  389.     (on (button any (together with-alt with-control))
  390.       (progn
  391.         (set-focus wob)
  392.         (wob-background (# 'foreground wob))
  393.         (with (
  394.         foreground (# 'background wob)
  395.         background (# 'foreground wob)
  396.           )
  397.           (wob-tile 
  398.         (active-label-make
  399.           (# 'title wob) (# 'font wob)))))
  400.       dvroom.edit-fsm.editable)
  401.     icon-behavior
  402.     standard-behavior
  403.     ))
  404.     (: dvroom.edit-fsm.editable
  405.       (state-make
  406.     (on (keypress (key-make edit-keys.return) any)
  407.       (dvroom.edit-fsm.de-edit)
  408.       dvroom.edit-fsm.normal)
  409.     (on (double-button any any)
  410.       (dvroom.edit-fsm.de-edit)
  411.       dvroom.edit-fsm.normal)
  412.     (on (keypress edit-keys.backspace any)
  413.       (progn
  414.         (## 'title wob 
  415.           (if (: s (match "\\(.*\\)."
  416.             (# 'title wob) 1))
  417.         s
  418.         (setq s "")))
  419.         (with (
  420.         foreground (# 'background wob)
  421.         background (# 'foreground wob)
  422.           )
  423.           (wob-tile (active-label-make s (# 'font wob))))
  424.     ))
  425.     (on (keypress edit-keys.delete any)
  426.       (progn
  427.         (## 'title wob (: s ""))
  428.         (with (
  429.         foreground (# 'background wob)
  430.         background (# 'foreground wob)
  431.           )
  432.           (wob-tile (active-label-make s (# 'font wob))))
  433.     ))
  434.     (on (keypress any any)
  435.       (progn
  436.         (## 'title wob 
  437.           (: s (+ (# 'title wob) (last-key))))
  438.         (with (
  439.         foreground (# 'background wob)
  440.         background (# 'foreground wob)
  441.           )
  442.           (wob-tile (active-label-make s (# 'font wob))))
  443.     ))
  444.     (on focus-out
  445.       (dvroom.edit-fsm.de-edit)
  446.       dvroom.edit-fsm.normal)
  447.     icon-behavior
  448.     standard-behavior
  449.     ))
  450. ))
  451. ))
  452.  
  453. (if (not (boundp 'update-icon))
  454.     (defun update-icon (update-icon.title)
  455.       (if (window-icon?)
  456.       (send-user-event 'get-title (window-icon)))))
  457.  
  458. (de dvroom.edit-fsm.de-edit ()
  459.   (wob-background (# 'background wob))
  460.   (with (background (# 'background wob)
  461.       foreground (# 'foreground wob)
  462.     )
  463.     (wob-tile (label-make (# 'title wob) (# 'font wob)))
  464.     (update-icon (# 'title wob)))
  465. )
  466.  
  467. ;
  468. ; find dvroom window belongs to
  469. ;
  470.  
  471. (defun find-window-in-any-dvroom (win)
  472.   (tag found-in-manager
  473.        (for dvr dvroom-managers
  474.         (with (slot (member win (nth 'rgroup dvr)))
  475.           (if slot (exit found-in-manager dvr))
  476.           )
  477.         )
  478.        )
  479.   )
  480.  
  481. ;
  482. ; detach window from all room managers
  483. ;
  484.  
  485. (defun remove-window-from-all-dvroom (win)
  486.   (with (dvr (find-window-in-any-dvroom win))
  487.     (if dvr (remove-from-dvroom-group dvr win))
  488.     )
  489.   )
  490.  
  491. ;
  492. ; automatic room attachment based upon name
  493. ;
  494.  
  495. (defun auto-window-attach (w)
  496.   (with (w-name (with (window w) (window-name)))
  497.     (with (d-name (match "\\(.*\\)::" w-name 1))
  498.           (if (< 0 (length d-name))
  499.           (with (dvr (find-dvroom-by-name d-name))
  500.             (if dvr
  501.     ;;
  502.     ;; by now, we've found a dvroom with the desired name
  503.     ;; just in case, try to detach this window from it's dvroom
  504.     ;; and attach it to the target dvroom
  505.     ;;
  506.                 (progn
  507.                   (qprint "Auto-Add " w-name " to " d-name "\n" )
  508.                   (remove-window-from-all-dvroom w)
  509.                   (add-to-dvroom-group dvr w)
  510.                   (set-x-property "GWM_ROOM" d-name)
  511.                   )
  512.               )
  513.             )
  514.         )
  515.           )
  516.     )
  517.   )
  518.  
  519. ;
  520. ; automatic room attachment for all windows
  521. ;
  522.  
  523. (defun magic-dvroom-attach ()
  524.   (for win (list-of-windows 'window)
  525.        (auto-window-attach win)
  526.        )
  527.   )
  528.  
  529. ;
  530. ; unmap all windows/icon that belong to a room
  531. ;
  532.  
  533. (defun dvroom-remapping ()
  534.   (for win (list-of-windows 'window)
  535.        (with (dvr (find-window-in-any-dvroom win))
  536.          (if dvr
  537.          (with (window win)
  538.                (if window-is-mapped (unmap-window win))
  539.                (if (window-icon?)
  540.                (with (window window-icon)
  541.                  (if window-is-mapped (unmap-window window-icon))
  542.                  )
  543.              )
  544.                )
  545.            )
  546.          )
  547.        )
  548.   )
  549.  
  550. ;
  551. ; Next dvroom number
  552. ;
  553.  
  554. (defun increment-dvroom ()
  555.   (with (room-leng (length dvroom-managers))
  556.     (if (> room-leng 0)
  557.         (if current-dvroom
  558.         (with (room (+ current-dvroom 1))
  559.               (if (= room (length dvroom-managers))
  560.               0
  561.             room
  562.             )
  563.               )
  564.           0
  565.           )
  566.       ()
  567.       )
  568.     )
  569.   )
  570.  
  571. ;
  572. ; Previous dvroom number
  573. ;
  574.  
  575. (defun decrement-dvroom ()
  576.   (with (room-leng (length dvroom-managers))
  577.     (if (> room-leng 0)
  578.         (if current-dvroom
  579.         (with (room (- current-dvroom 1))
  580.               (if (< room 0)
  581.               (- room-leng 1)
  582.             room
  583.             )
  584.               )
  585.           (- room-leng 1)
  586.           )
  587.       ()
  588.       )
  589.     )
  590.   )
  591.  
  592. ;
  593. ; Close current Room
  594. ;
  595.  
  596. (defun close-current-dvroom ()
  597.   (if current-dvroom
  598.       (with (window (# current-dvroom dvroom-managers))
  599.         (progn
  600.           (close-dvroom)
  601.           (setq current-dvroom ())
  602.           (pre-dvrooms-iconify-window)
  603.           )
  604.         )
  605.     )
  606.   )
  607.  
  608. ;
  609. ; Open dvroom by number
  610. ;
  611.  
  612. (defun open-room-number (room)
  613.   (if room
  614.       (progn
  615.     (close-current-dvroom)
  616.     (with (window (# room dvroom-managers))
  617.           (progn
  618.         (open-dvroom)
  619.         (setq current-dvroom room)
  620.         (with (window window-icon)
  621.               (pre-dvrooms-iconify-window)
  622.               )
  623.         )
  624.           )
  625.     )
  626.     )
  627.   )
  628.  
  629. ;
  630. ; Open next room
  631. ;
  632.  
  633. (defun roll-rooms-up ()
  634.   (open-room-number (increment-dvroom))
  635.   )
  636.  
  637. ;
  638. ; Open previous room
  639. ;
  640.  
  641. (defun roll-rooms-down ()
  642.   (open-room-number (decrement-dvroom))
  643.   )
  644.  
  645. ;; adds the "add to room" and "remove from room" menu items in the
  646. ;; window menu, "New dvroom" in the root menu
  647.  
  648. (if (not (boundp 'dvroom.menu-added)) (progn
  649.     (setq dvroom.menu-added t)
  650.     
  651.     (if (eq window-pop-items icon-pop-items)
  652.       (setq window-pop-equals-icon-pop t)
  653.       (setq window-pop-equals-icon-pop ()))
  654.     
  655.     (insert-at '(item-make "New dvroom" (new-dvroom-manager))
  656.       root-pop-items
  657.       dvroom.rootmenupos)
  658.     (insert-at '(multi-item-make 
  659.     "Room: "
  660.     ()
  661.     ("Add" (add-to-dvroom))
  662.     ("Remove" (remove-from-dvroom)))
  663.       window-pop-items
  664.       dvroom.menupos)
  665.     
  666.     (if window-pop-equals-icon-pop
  667.       (setq icon-pop-items window-pop-items))
  668. ))
  669.