在WX中通常会用到StaticText和TextCtrl来显示字符。类似于MFC中的 Static 和 Edit。TextCtrl可以设置更多属性,但是他有边框,有底色。
他们的默认显示效果,如下图:
code如下:
import wx
class MainFrame(wx.Frame):
def __init__(self, iid=-1, redirect=True, parent=None, pos=wx.DefaultPosition, title='RCL Update v1.0'):
# MainFrame
wx.Frame.__init__(self,
parent, iid, title, pos, (720, 150),
wx.DEFAULT_FRAME_STYLE ^ (wx.RESIZE_BORDER | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX))
self.SetLabel('python wx StaticText and TextCtrl Test')
panel = wx.Panel(self)
self.statusText = wx.StaticText(panel, -1, 'StaticText sample', (20, 20