- 论坛徽章:
- 0
|
自己试着写了一个对话框class,想在对话框关闭事件中做一些判断,使用
Bind(wx.EVT_CLOSE,self.OnCloseWindow)但是不成功。高手帮忙
看看。(电视里面意大利对罗马尼亚刚好一比一了.)
import wx
class myDialog(wx.Dialog):
def __init__(self,parent,id,title):
self.value = 0
wx.Dialog.__init__(self,parent,id,title,(-1,-1),(300,300),wx.CAPTION|wx.CLOSE_BOX,"myDialog")
self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
def OnCloseWindow(self,event):
dial = wx.MessageDialog(None, 'Are you sure to quit?', 'Question',
wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
ret = dial.Show() |
[ 本帖最后由 dengwangxi 于 2008-6-14 01:55 编辑 ] |
|