Hi to all. I have one notebook with some tabs in my form and in this tabs i have label-button for closing tab. I have code for this:
def new_tab(self,label): self.scrolled_window = gtk.ScrolledWindow()
self.add(self.scrolled_window)
self.scrolled_window.add_with_viewport(self.editor_access())
self.scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
label = self.create_tab_label(label,self.editor_access)
self.set_tab_label_packing(self.scrolled_window,False,False,2)
self.set_tab_label(self.scrolled_window,label)
self.saving = False
self.already_save.insert(0,self.get_n_pages() - 1)
label.show_all()
self.show_all()
return self.editor
def create_tab_label(self, title, tab_child): box = gtk.HBox() label = gtk.Label(title) closebtn = gtk.Button()
image = gtk.Image()
image.set_from_stock(gtk.STOCK_CLOSE, gtk.ICON_SIZE_MENU)
closebtn.set_image(image)
closebtn.set_relief(gtk.RELIEF_NONE)
box.pack_start(label, True, True)
box.pack_end(closebtn, False, False)
self.show_all()
closebtn.connect("clicked",self.close_tab)
return box
How can i get page_num of tab which I closed with this button?
Thank you.