I have 2 frames in my wxpython program,
MyFrame and OptionFrame
if I start my program it shows MyFrame, and if I end it, the frame disappears and the program stops.

If I start my program and choose to show the option frame, it will show it, but if I now close both frames the program keeps running in the background..

How can I stop this?

If I start my program and choose to show the option frame, it will show it, but if I now close both frames the program keeps running in the background..

It would be helpful if you showed us the relative code (ie, how you're opening the Optionframe and how you're destroying/closing it).

When you say "close both frames" do you mean click the "X" window button? Or does something in your code close them?

I mean the "X" button =)
I open it with:

self.opframe = OptionFrame(None, -1, "")
self.opframe.Show()

there is no code for closing it ...

btw OptionFrame is a class

class OptionFrame(wx.Frame):
   def __init__(self, *args, **kwds):
     # begin wxGlade: OptionFrame.__init__
     kwds["style"] = wx.DEFAULT_FRAME_STYLE
     wx.Frame.__init__(self, *args, **kwds)
     ....

Edited 7 Years Ago by Kruptein: n/a

I mean the "X" button =)
I open it with:

self.opframe = OptionFrame(None, -1, "")
self.opframe.Show()

I haven't done any work in wxPython for over two years but perhaps it's related to opframe having a parent of None. Perhaps its parent should be the main frame?

It didn't work,
I tried: self.opframe = OptionFrame(MyFrame(self), -1, "") But in commandline the program keeps running..

It didn't work,
I tried: self.opframe = OptionFrame(MyFrame(self), -1, "") But in commandline the program keeps running..

If your main frame is creating this OptionFrame (ie, if the "self" in the above code is actually the instance of MyFrame) then you should be doing just self.opframe = OptionFrame(self, -1, "") . See if that gives you any joy

This article has been dead for over six months. Start a new discussion instead.