Another Question

Gandalf goldnery at gmail.com
Sat May 24 03:39:06 EDT 2008


On May 23, 10:47 pm, Mike Driscoll <kyoso... at gmail.com> wrote:
> On May 23, 1:44 pm, Gandalf <goldn... at gmail.com> wrote:
>
> > you've been very helpful but still i have only one problem. I wont the
> > window not to be close after clicking the X button.
> > I wont the program to stay on the toolbar
>
> > thanks!
>
> Well then, in your event handler, just don't do anything.
>
> def onClose(self, event):
>     pass
>
> or maybe you want to hide the frame?
>
> def onClose(self, event):
>     self.frame.Hide()
>
> Just make sure you give the user some other way to close it and in
> that handler, you'll need to call self.frame.Destroy().
>
> Alternatively, you can just tell the frame not to create the "X"
> button:
>
> self.frame = wx.Frame(None, -1, title="My Frame",
> style=wx.SYSTEM_MENU)
>
> However, that makes it pretty annoying to close.
>
> Mike

OK the first method still didn't work. no matter what i do the window
keep closing but the last one worked nice and all the top menu
disappear

thanks!



More information about the Python-list mailing list