views:

169

answers:

0

Hi to all. I have notebook on my form and on each notebook's tab i have gtk.TextView. textview adding automaticaly when new notebook's tab add. Let's say I want to open a file in 3 textview into 3 tabs and when i open file i want that in tab-label will be file path.

Tab add:

  def new_tab(self):
  scrolled_window = gtk.ScrolledWindow()

  self.add(scrolled_window)
  scrolled_window.add_with_viewport(self.editor_access())

  scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)

  label = self.create_tab_label("New File",self.editor_access)

  self.set_tab_label_packing(scrolled_window,False,False,2)
  self.set_tab_label(scrolled_window,label)

  label.show_all()

  return self.editor

where editor_access() -

  def editor_access(self):
  self.editor = Editor()
  return self.editor

and Editor class -

    class Editor(gtk.TextView):

  def __init__(self):
    gtk.TextView.__init__(self)

In file open event i open file and then

self.tab_panel.set_tab_label_text(self.tab_panel.editor_access(),"path/file")

But tab-label not change :(

How can i resolve this problem?

Thank you.