def present_frame(frame, ui_parent=None): wxframe = wx.Frame(None, -1, title=frame.label) sizer = wx.BoxSizer(wx.VERTICAL) sizer.SetMinSize((700, 300)) splitter = wx.SplitterWindow(wxframe, -1, style=wx.SP_LIVE_UPDATE | wx.NO_BORDER | wx.SP_3DSASH) core.present(frame.sidebar, splitter) core.present(frame.dashboard, splitter) # Find all actions that want to be included in # the toolbar toolbar = None for cmd in frame: if cmd.hints.get('toolbar'): if toolbar is None: style = (wx.TB_HORIZONTAL | getattr(wx, 'TB_MAC_NATIVE_SELECT', 0) | wx.TB_3DBUTTONS | wx.TB_TEXT) toolbar = wxframe.CreateToolBar(style=style) core.present(cmd, toolbar) if toolbar is not None: toolbar.Realize() sizer.Add(splitter, 1, wx.EXPAND|wx.BOTTOM|wx.TOP) splitter.SplitVertically(splitter.Children[0], splitter.Children[1], 0.24 * sizer.MinSize.width) wxframe.SetSizer(sizer) wxframe.SetAutoLayout(True) sizer.Fit(wxframe) wxframe.CenterOnScreen() wxframe.Show() return frame
def present_frame(frame, ui_parent=None): wxframe = wx.Frame(None, -1, title=frame.label) sizer = wx.BoxSizer(wx.VERTICAL) sizer.SetMinSize((700, 300)) splitter = wx.SplitterWindow(wxframe, -1, style=wx.SP_LIVE_UPDATE | wx.NO_BORDER | wx.SP_3DSASH) core.present(frame.sidebar, splitter) core.present(frame.dashboard, splitter) # Find all actions that want to be included in # the toolbar toolbar = None for cmd in frame: if cmd.hints.get('toolbar'): if toolbar is None: style = (wx.TB_HORIZONTAL | getattr(wx, 'TB_MAC_NATIVE_SELECT', 0) | wx.TB_3DBUTTONS | wx.TB_TEXT) toolbar = wxframe.CreateToolBar(style=style) core.present(cmd, toolbar) if toolbar is not None: toolbar.Realize() sizer.Add(splitter, 1, wx.EXPAND | wx.BOTTOM | wx.TOP) splitter.SplitVertically(splitter.Children[0], splitter.Children[1], 0.24 * sizer.MinSize.width) wxframe.SetSizer(sizer) wxframe.SetAutoLayout(True) sizer.Fit(wxframe) wxframe.CenterOnScreen() wxframe.Show() return frame
def load_wxui(app): """Code to hook up a wx UI to app's interaction model""" import chandler.wxui.table # big cheat for frame in app.top_level: core.present(frame, None)