def CreateItem(self, parent): """Returns an IPythonShell Panel""" self._log = wx.GetApp().GetLog() self._log("[xPyShell][info] Creating IPythonShell instance for Shelf") #main_win = wx.GetApp().GetMainWindow() #parent.AddPage(self.history_panel,'IPythonHistory',False) splitter = wx.SplitterWindow(parent, -1, style=wx.SP_LIVE_UPDATE) self.history_panel = IPythonHistoryPanel(splitter) self.history_panel.setOptionTrackerHook(self.OptionSave) self.ipython_panel = IPShellWidget(splitter, background_color="BLACK") #user_ns=locals(),user_global_ns=globals(),) self.ipython_panel.setOptionTrackerHook(self.OptionSave) self.ipython_panel.setHistoryTrackerHook(self.history_panel.write) options_ipython = self.ipython_panel.getOptions() for key in options_ipython.keys(): saved_value = profiler.Profile_Get('IPython.' + key) if saved_value is not None: options_ipython[key]['value'] = saved_value options_history = self.history_panel.getOptions() for key in options_history.keys(): saved_value = profiler.Profile_Get('IPython.' + key) if saved_value is not None: options_history[key]['value'] = saved_value self.ipython_panel.reloadOptions(options_ipython) self.history_panel.reloadOptions(options_history) splitter.SetMinimumPaneSize(20) splitter.SplitVertically(self.ipython_panel, self.history_panel, -100) #splitter.SplitVertically(frame, self.history_panel, -100) ### for better split window sizing behavior self._splitter = splitter shell_window = splitter.GetWindow1() shell_window.SetMinSize((500, 0)) history_window = splitter.GetWindow2() history_window.SetMinSize((100, 0)) splitter.SetSashGravity(0.7) return splitter