程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

19 text class application of xwpython GUI interface

編輯:Python

xwPython Of GUI Text application of interface

import wx
class MyFrame(wx.Frame):
def __init__(self,parent,id):
wx.Frame.__init__(self, parent,id, title=" establish TextCtrl class ",size=(400, 300))
# Create panels 
panel = wx.Panel(self)
# Create text and password input boxes 
self.title = wx.StaticText(panel ,label=" Please enter your user name and password ",pos=(140,20))
self.label_user = wx.StaticText(panel,label=" user name :",pos=(50,50) )
self.text_user = wx.TextCtrl(panel,pos=(100,50),size=(235,25),style=wx.TE_LEFT)
self.label_pwd = wx.StaticText(panel,pos=(50,90),label=" The secret code :")
self.text_password = wx.TextCtrl(panel,pos=(100,90),size=(235,25),style=wx.TE_PASSWORD)
# establish “ determine ” and “ Cancel ” Button 
self.bt_confirm = wx.Button(panel,label=' determine ',pos=(105,130))
self.bt_cancel = wx.Button(panel,label=' Cancel ',pos=(195,130))
if __name__ == '__main__':
app = wx.App() # initialization 
frame = MyFrame(parent=None,id=-1) # example MyFrame class , And pass the parameters 
frame.Show() # Display window 
app.MainLoop() # Call the main loop method 



  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved