Tricky (?) popup issue... Thread last updated on 2004-02-26 13:35:06

Posted by member 88602 on 2004-02-25 01:05:06

Here's the problem: By default a popup closes as soon as I click on one of its entries (if it's not a folder). In order to apply changes directly onto the popup (i.e. transparency via bang) I want it to stay open until I click somewhere else. Any ideas?

Posted by member 7 on 2004-02-25 13:15:01 link

try using a pinned popup

Posted by member 88602 on 2004-02-25 14:22:35 link

That's the idea but how would you do a sub-popup that's pinned by default...?

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

Posted by member 7 on 2004-02-26 13:35:06 link

You're right, it wouldn't work for a submenu. You'd have to make it a separate !PopupXYZ. But then you could use this (Popup2 2.1.6 required).