1、实现了第一步,GUI界面的初步布局
"""
1、实现了UI界面的概要布局
"""
import wx
class UI_testframe:
def __init__(self):
self.app = wx.App()
self.window = wx.Frame(None, title="测试框架v1.0", size=(400, 300))
self.panel = wx.Panel(self.window)
self.lbl_file=wx.StaticText(self.panel, label="测试框架配置文件")
self.txt_file=wx.TextCtrl(self.panel)
self.but_open=wx.Button(self.panel, label="打开")
self.but_run = wx.Button(self.panel, label="执行")
self.but_clear = wx.Button(self.panel, label="重置")
self.but_exit = wx.Button(self.panel, label="退出")
def UI_layout(self):
box1 = wx.BoxSizer()
box1.Add(self.lbl_file)
box1.Add(self.txt_file)
box1.Add(self.but_open)
box2 = wx.BoxSizer()
box2.Add(self.but_run)
box2.Add(self.but_clear)
box2.Add(self.but_exit)
box3 = wx.BoxSizer(wx.VERTICAL)
box3.Add(box1)
box3.Add(box2)
self.panel.SetSizer(box3)
def UI_show(self):
self.window.Show()
self.app.MainLoop()
if __name__ == '__main__':
a = UI_testframe()
a.UI_layout()
a.UI_show()