mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-12 23:07:07 +01:00
16 lines
604 B
Python
16 lines
604 B
Python
# In Python we don't have to worry about the stack vs. the heap, however
|
|
# that means that dialogs do need to be destroyed. The typical pattern for
|
|
# dialog usage looks something like this:
|
|
def AskUser(self):
|
|
try:
|
|
dlg = MyAskDialog(self)
|
|
if dlg.ShowModal() == wx.ID_OK:
|
|
# do something here
|
|
print('Hello')
|
|
else:
|
|
# handle dialog being cancelled or ended by some other button
|
|
...
|
|
finally:
|
|
# explicitly cause the dialog to destroy itself
|
|
dlg.Destroy()
|