wxDialog is not destroyed in presence of pygame window

Hi,

first, a little Introduction :slight_smile: :
I'm paul, computing science student in germany. Nice to meet you guys.

Now, on with my problem. I wrote a little wxPython application with one frame, four text fields and two buttons. I also use pygame for simple and fast 2D drawing, and this seems to pose a problem in conjunction with modal dialogs. To load a file I open up a wx.FileDialog which I Destroy() after the file was loaded and some calculations have been made.

Now, as long as no pygame window is opened everthing works fine. As soon as the pygame window is present, the file dialogs seem to not be destroyed properly any more. They remain as 'corpses', just plain white rectangles which clutter up the screen. Even more puzzling is the fact that I also use progress dialogs (which are also newly created when needed), but with them the problem does not occur. The only difference I see right now is that the progress dialogs are stored in a field of the main window class, whereas the file dialogs are stored in local variables.

I think the problem could be that the pygame window, since it's not integrated with the wx framework and all other wx windows, might block certain events which need to be processed. But I don't know which events that could be.

I'm on a mac running OS X 10.4.6 with macpython-2.3 and wxPython-2.6-mac.

Thanks for reading,

paul

Paul Maier wrote:

Hi,

first, a little Introduction :slight_smile: :
I'm paul, computing science student in germany. Nice to meet you guys.

Now, on with my problem. I wrote a little wxPython application with one frame, four text fields and two buttons. I also use pygame for simple and fast 2D drawing, and this seems to pose a problem in conjunction with modal dialogs. To load a file I open up a wx.FileDialog which I Destroy() after the file was loaded and some calculations have been made.

Now, as long as no pygame window is opened everthing works fine. As soon as the pygame window is present, the file dialogs seem to not be destroyed properly any more. They remain as 'corpses', just plain white rectangles which clutter up the screen. Even more puzzling is the fact that I also use progress dialogs (which are also newly created when needed), but with them the problem does not occur. The only difference I see right now is that the progress dialogs are stored in a field of the main window class, whereas the file dialogs are stored in local variables.

I think the problem could be that the pygame window, since it's not integrated with the wx framework and all other wx windows, might block certain events which need to be processed. But I don't know which events that could be.

Other than running some of the samples now and then I'm not familiar with pygame, but I agree with your assessment. It sounds like pygame is blocking the wx event loop. When you launch the pygame window do you have an event processing loop (or similar) that prevents the wx event handler from returning to MainLoop?

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!