#!/usr/bin/env python
# _*_ coding:utf-8 _*_
import wx
class TestPanel(wx.Panel):
def __init__(self,parent):
wx.Panel.__init__(self,parent,-1)
b = wx.Button(self,-1,"Create and Show a TextEntryDialog",(50,50))
self.Bind(wx.EVT_BUTTON,self.OnButton,b)
def OnButton(self,EVT):
dlgtext = wx.TextEntryDialog(self,'What is your favorite programming language?','perl','python')
dlgtext.SetValue('python is good')
if dlgtext.ShowModal() == wx.ID_OK:
dlgmsg = wx.MessageDialog(self,dlgtest.GetValue(),'A Message Box',wx.OK | wx.ICON_INFORMATION)
dlgmsg.Center()
dlgmsg.ShowModal()
dlgmsg.Destroy()
dlgtext.Destroy()
if __name__ == '__main__':
app = wx.App()
frame = wx.Frame(None)
p = TestPanel(frame)
frame.Show()
app.MainLoop()
阅读(4088) | 评论(0) | 转发(0) |