def show_default_page(self): if self.default_widget != None and len(self.tab_items) == 0: container_remove_all(self.tab_content_box) self.tab_content_box.add(self.default_widget) self.tab_title_box.queue_draw() self.tab_content_box.queue_draw() self.show_all()
def set_item_widget(self, item): if isinstance(item, PreferenceItem): container_remove_all(self.right_box) self.right_box.pack_start(item.item_widget) self.category_bar.select_items([item]) return True else: return False
def show_default_page(self): ''' Show default page. ''' if self.default_widget != None and len(self.tab_items) == 0: container_remove_all(self.tab_content_box) self.tab_content_box.add(self.default_widget) self.tab_title_box.queue_draw() self.tab_content_box.queue_draw() self.show_all()
def set_buttons(self, buttons): ''' Set buttons in box. @note: This function will use new buttons B{instead} old buttons in button box. @param buttons: A list of Gtk.Widget instance. ''' container_remove_all(self.button_box) for button in buttons: self.button_box.pack_start(button, False, False, 4)
def switch_content(self, index): '''Switch content.''' if self.tab_index != index: self.tab_index = index widget = self.tab_items[index][1] container_remove_all(self.tab_content_box) self.tab_content_box.add(widget) self.tab_title_box.queue_draw() self.tab_content_box.queue_draw() self.show_all()
def switch_content(self, index): ''' Switch content with given index. @param index: Tab index. ''' if self.tab_index != index and len(self.tab_items): self.tab_index = index widget = self.tab_items[index][1] container_remove_all(self.tab_content_box) self.tab_content_box.add(widget) self.tab_title_box.queue_draw() self.tab_content_box.queue_draw() self.show_all()
def hide_titlebar(self): """ Hide the title bar. """ container_remove_all(self.titlebar_box)
def hide_titlebar(self): ''' Hide the title bar. ''' container_remove_all(self.titlebar_box)
def set_buttons(self, buttons): '''Add buttons.''' container_remove_all(self.button_box) for button in buttons: self.button_box.pack_start(button, False, False, 4)