GUI

import wx
class MyFrame(wx.Frame):
def __init__(self,parent,id):
wx.Frame.__init__(self,parent,id,title="创建TextCtrl类",size=(400,300))

panel =wx.Panel(self)

self.title = wx.StaticText(panel,label="请输入姓名和班级",pos=(140,20))
self.label_user=wx.StaticText(panel,label="姓名:",pos=(50,50))
self.text_user=wx.TextCtrl(panel,pos=(100,50),size=(235,25),style=wx.TE_LEFT)
self.label_user=wx.StaticText(panel,pos=(50,90),label="班级:")
self.text_user=wx.TextCtrl(panel,pos=(100,90),size=(235,25),style=wx.TE_LEFT)
self.label_user=wx.StaticText(panel,label="学号:",pos=(50,130))
self.text_user=wx.TextCtrl(panel,pos=(100,130),size=(235,25),style=wx.TE_LEFT)
self.bt_confirm=wx.Button(panel,label='确定',pos=(105,170))
self.bt_cancel=wx.Button(panel,label='取消',pos=(195,170))
if __name__=='__main__':
app=wx.App() #初始化应用
frame=MyFrame(parent=None,id=-1)#实例MyFrame类,并传递参数
frame.Show() #显示窗口
app.MainLoop() #调用主循环方法

 

GUI

 

上一篇:文本域JScroll面板


下一篇:numpy、scipy、pandas、matplotlib的读书报告