def _pack_panes(self, bufferview, pluginview): p0 = gtk.HPaned() self.__mainbox.pack_start(p0) sidebar_width = self.__manager.opt('layout', 'sidebar_width') sidebar_on_right = self.__manager.opt('layout', 'sidebar_on_right') sidebar = self._create_sidebar(bufferview, pluginview) p1 = gtk.VPaned() if sidebar_on_right: side_func = p0.pack2 main_func = p0.pack1 main_pos = 800 - sidebar_width else: side_func = p0.pack1 main_func = p0.pack2 main_pos = sidebar_width side_func(sidebar, resize=False) main_func(p1, resize=True) p0.set_position(main_pos) editor = contentbook.Contentholder(show_tabs=False) self.__viewbooks['edit'] = editor p1.pack1(editor, resize=True) viewbook = contentbook.Contentholder() self.__viewbooks['view'] = viewbook p1.pack2(viewbook, resize=False) extb = self.__viewbooks['ext'] = external_book() p1.set_position(430) self.resize(800, 600)
def __init__(self, *args): super(external_window, self).__init__() self.__book = contentbook.Contentholder() self.__book.notebook.set_show_tabs(False) self.add(self.__book) self.connect('destroy', self.on_window__destroy) self.resize(600, 480) self.set_position(gtk.WIN_POS_CENTER) self.__book.connect('empty', self.cb_empty)
def _pack_panes(self, bufferview, pluginview, languageview): # Horizontal paned for editor and sidebar p0 = gtk.HPaned() p0.show() self.__mainbox.pack_start(p0) # Make it possible to move the sidebar on the left or right sidebar_width = self.__manager.opt('layout', 'sidebar_width') sidebar_on_right = self.__manager.opt('layout', 'sidebar_on_right') # Creates the sidebar sidebar = self._create_sidebar(bufferview, pluginview, languageview) sidebar.show() # Places sidebar if sidebar_on_right: side_func = p0.pack2 main_func = p0.pack1 main_pos = 800 - sidebar_width else: side_func = p0.pack1 main_func = p0.pack2 main_pos = sidebar_width p1 = gtk.VPaned() p1.show() side_func(sidebar, resize=False) main_func(p1, resize=True) p0.set_position(main_pos) # Place the editor editor = contentbook.Contentholder(show_tabs=False) editor.show() self.__viewbooks['edit'] = editor p1.pack1(editor, resize=True) viewbook = contentbook.Contentholder() self.__viewbooks['view'] = viewbook p1.pack2(viewbook, resize=False) extb = self.__viewbooks['ext'] = external_book() p1.set_position(430) self.resize(800, 600)
def _pack_panes(self, bufferview, pluginview, languageview): editor = contentbook.Contentholder(show_tabs=False) self.__viewbooks['edit'] = editor self.set_main_widget(editor) self._create_paneholder('view', gtk.POS_BOTTOM) sidebar_on_right = self.__manager.opt('layout', 'sidebar_on_right') if sidebar_on_right: panepos = gtk.POS_RIGHT langpos = gtk.POS_LEFT else: panepos = gtk.POS_LEFT langpos = gtk.POS_RIGHT #self._create_paneholder('language', langpos) sidebar = self._create_sidebar(bufferview, pluginview, languageview) self.set_pane_widget(panepos, sidebar) self.set_pane_sticky(panepos, True) extb = self.__viewbooks['ext'] = external_book() extb.window.set_transient_for(self)
def _create_paneholder(self, name, position): viewbook = contentbook.Contentholder() self.__viewbooks[name] = viewbook self.set_pane_widget(position, viewbook) viewbook.connect('empty', self.cb_empty, name)