10 |
|
|
11 |
__version__ = "$Revision$" |
__version__ = "$Revision$" |
12 |
|
|
|
from wxPython.wx import wxFrame, wxDEFAULT_FRAME_STYLE, EVT_CLOSE |
|
|
|
|
|
#class NonModalDialog(wxFrame): |
|
|
# |
|
|
# def __init__(self, parent, name, title): |
|
|
# wxFrame.__init__(self, parent, -1, title, |
|
|
# style = wxDEFAULT_FRAME_STYLE ) |
|
|
# self.parent = parent |
|
|
# self.name = name |
|
|
# EVT_CLOSE(self, self.OnClose) |
|
|
# |
|
|
# def OnClose(self, event): |
|
|
# self.parent.remove_dialog(self.name) |
|
|
# self.Destroy() |
|
|
# |
|
13 |
from wxPython.wx import * |
from wxPython.wx import * |
14 |
|
|
15 |
|
class ThubanFrame(wxFrame): |
16 |
|
|
17 |
|
def __init__(self, parent, name, title): |
18 |
|
wxFrame.__init__(self, parent, -1, title, |
19 |
|
style = wxDEFAULT_FRAME_STYLE ) |
20 |
|
self.parent = parent |
21 |
|
self.name = name |
22 |
|
EVT_CLOSE(self, self.OnClose) |
23 |
|
EVT_WINDOW_DESTROY(self, self.OnDestroy) |
24 |
|
|
25 |
|
def OnClose(self, event): |
26 |
|
# FIXME: Shouldn't this really be in OnDestroy? |
27 |
|
if self.parent.dialogs.has_key(self.name): |
28 |
|
self.parent.remove_dialog(self.name) |
29 |
|
self.Destroy() |
30 |
|
|
31 |
|
def OnDestroy(self, event): |
32 |
|
"""Implement in derived classes for resource cleanup, etc.""" |
33 |
|
|
34 |
|
|
35 |
class NonModalDialog(wxDialog): |
class NonModalDialog(wxDialog): |
36 |
def __init__(self, parent, name, title): |
def __init__(self, parent, name, title): |
37 |
wxDialog.__init__(self, parent, -1, title, |
wxDialog.__init__(self, parent, -1, title, |