Posted by member 37809 on 2004-02-25 17:59:56 link

My favorite thing to do here is to open the popup in the same position again.

But this trick only "keeps" the top level open.

The Idea: initially you open the popup at some location, and then per entry with which you want the popup to persist, call !Popup (or the bang of the popup) x=blah y=bleh

Note: I don't think this will work if you intend to use this with !Popup or !PopupTheme and still be OTS2 compliant, since the desktop clicks are defined in your personal.rc.

Here's some mzscript anyway:
; set the popup and position, then open it
*script bang !persistpopup_init
*script exec !varset persistpopup_name %{\1}
*script exec !varset persistpopup_pos %{mousex}:%{mousey}
*script exec !persistpopup !none
*script ~bang

; execute a command and reopen popup at saved location
*script bang !persistpopup
*script exec !exec %{args}
*script exec !Popup%{persistpopup_name} x=%{persistpopup_pos:} y=%{persistpopup_pos:_}
*script ~bang


You could start the behavior for !PopupFOO by calling !persistpopup_init FOO
; prepend your popup entries' action with !persistpopup
*popup "Foobie Doobie" !New !PopupFOO
*popup "Do something and" !persistpopup !lalala
*popup "Reopen popup." !persistpopup !lelele
*popup ~New