import wx class MainWin(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, wx.ID_ANY, "Dagon Controller") self.main_sizer = wx.BoxSizer(wx.VERTICAL) # Top buttons self.top_sizer = wx.BoxSizer(wx.HORIZONTAL) self.plan_btn = wx.Button(self, label="Plan", style=wx.BU_EXACTFIT) self.conn_btn = wx.Button(self, label="(Re)Connect", style=wx.BU_EXACTFIT) self.ser_sel = wx.Choice(self, choices=["(none)"]) for i in (self.plan_btn, self.conn_btn, self.ser_sel): self.top_sizer.Add(i, 1, wx.EXPAND) self.main_sizer.Add(self.top_sizer, 1, wx.EXPAND) self.commbox = wx.TextCtrl(self, style= wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH2) self.main_sizer.Add(self.commbox, 1, wx.EXPAND) self.SetSizer(self.main_sizer) self.SetAutoLayout(1) self.main_sizer.Fit(self) self.Show(True)