#coding=utf-8
import wx
import time
import os
class MyApp(wx.App):
def __init__(self):
wx.App.__init__(self)
def OnInit(self):
self.Frame = wx.Frame(parent=None,title = "我的第一个GUI程序",pos = (350,200),size = (1000,800))
self.Frame.SetMaxSize((1000,800))
self.Frame.SetMinSize((1000,800))
self.SetTopWindow(self.Frame)
self.panel = wx.Panel(self.Frame,-1)
self.Set_Ui_text()
self.Set_Button()
self.Set_Test_Ctrl()
self.Set_Image()
self.Set_Menu()
self.Set_Radio_Box()
self.Set_List_Box()
#image1 = wx.Image("timg.bmp")
#mage = wx.StaticBitmap(self.panel,-1,wx.BitmapFromImage(image1))
sizer =self.Set_Sizer()
self.Frame.SetSizer(sizer)
#self.Frame.Fit()
self.Frame.Show()
return True
def Set_Sizer(self):
sizer = wx.GridSizer(rows = 4,cols = 4 ,hgap = 5,vgap = 5)
#sizer.Add(self.button)
sizer.Add(self.inputext)
#sizer.Add(mage)
sizer.Add(self.radiobox1)
sizer.Add(self.radiobox2)
sizer.Add(self.listbox1)
sizer.Add(self.listbox2)
sizer.Add(self.listbox3)
sizer.Add(self.listbox4)
sizer.Add(self.gauge1)
sizer.Add(self.slider)
sizer.Add(self.button1)
return sizer
def Set_Ui_text(s
wxpython模板程序,包括各个实例
最新推荐文章于 2021-01-03 16:31:23 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)