The problem with closing the window OSD

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

The problem with closing the window OSD

Post by Pako » Mon Oct 20, 2008 6:23 pm

I encountered an interesting problem. I met with him in my plug Multitap. Sometimes it becomes (especially if the computer is more busy), on the screen remains open window "OSD Multitap", but EG already not knows about it. I must to close it manually using the "Alt-F4". I need advice on how to properly treat.
Now there the following:

Code: Select all

    self.osDialog.Destroy()
    self.osDialog = None
However, sometimes it does not work. It has to do with threading?

Thanks,

Pako

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

Re: The problem with closing the window OSD

Post by Bitmonster » Mon Oct 20, 2008 6:42 pm

I haven't look into your code till now, but such problems arise if you call wx-functions outside the GUI main thread and actions mostly run in the eg.actionThread. The only exception is the Configure() method that runs in the GUI thread.

So you have to use wx.CallAfter in all other threads contexts to put some function on the GUI thread, that will handle the wxPython stuff from the GUI thread.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: The problem with closing the window OSD

Post by Pako » Mon Oct 20, 2008 7:31 pm

Thanks !
I tried apply wx.CallAfter and so far it works.
However, it is not certain that it no longer happen. Must be to test a long time.

Pako

Post Reply