Popup window for confirmation from an action

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
User avatar
dexter98
Plugin Developer
Posts: 49
Joined: Sun Dec 30, 2007 2:45 am
Location: Netherlands
Contact:

Popup window for confirmation from an action

Post by dexter98 » Sun Jul 06, 2008 1:49 pm

I'm working on an playlist generator plugin and I want to add an action where the user is presented the generated playlist, which he can accept or decline.

The underlying logic is working, but I'm having difficulties in getting a working popup window. I only want EG to continue with processing next actions if this window is closed.

How to do this?

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Popup window for confirmation from an action

Post by Bitmonster » Sun Jul 06, 2008 3:17 pm

Displaying a dialog window and suspending execution of the macro till the user has made a choice would be possible, *BUT* while the action is blocked, the user will not be able to use his remote to dismiss this dialog, because EG only processes one macro after another. And I guess you don't want to limit your action to keyboard and mouse handling.

To circumvent this, the action would need to initiate an event, that later triggers another macro to do the actual transfer of the playlist.

And there is another problem. The actions __call__ runs in another thread than the wxPython GUI stuff. To use wxPython in the action while it is executing, you have to do some "thread ping-pong". I can show you this, but the first problem is much more severe.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

jsonnabend
Experienced User
Posts: 127
Joined: Wed Apr 23, 2008 7:35 pm

Re: Popup window for confirmation from an action

Post by jsonnabend » Sun Jul 06, 2008 3:50 pm

I hope this is at least a bit on point. I have a program that presents a dialog prompt to users (after selecting a playlist, wouldn't you know). It's not an EG plugin. It is a separate program written in Delphi that sits between my music database (CATraxx) and Winamp, intercepting play requests from the former and sending them to the latter.

To deal with the prompt issue, I have EG set a very high level exclusive for the prompt dialog whenever it appears, effectively shutting down all other input processing. That way, whatever the user does, the dialog receives the input. I imagine a similar thing could be done with a Python dialog, no?

-Jeff

Post Reply