Skip to content

Instantly share code, notes, and snippets.

@CountChu
Last active October 23, 2016 07:19
Show Gist options
  • Save CountChu/cdc6435892719c03f29fe19971609392 to your computer and use it in GitHub Desktop.
Save CountChu/cdc6435892719c03f29fe19971609392 to your computer and use it in GitHub Desktop.
Apply HTML coding habit in wxPython sizer for UI layout
def __init__ (self):
wx.Frame.__init__ (self, None, -1, self.Title)
if "<TABLE>":
self.Hs = wx.BoxSizer (wx.VERTICAL)
if "<TR>":
self.St = wx.StaticText(self, label="Your name :", pos=(20,60))
self.Hs.Add (self.St)
if "<TR>":
self.Vs = wx.BoxSizer (wx.HORIZONTAL)
if "<TD>":
self.St2 = wx.StaticText(self, label="...", pos=(20,60))
self.Vs.Add (self.St2)
if "<TD>":
self.Logger = wx.TextCtrl (self, 5, "", wx.Point (0,0), wx.Size (-1, -1), \
wx.TE_MULTILINE | wx.TE_READONLY)# | wx.TE_RICH2)
self.Logger.SetBackgroundColour((255,255,0))
self.Vs.Add (self.Logger, 1, wx.EXPAND)
self.Hs.Add (self.Vs, 1, wx.EXPAND)
self.SetSizer (self.Hs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment