[pygtk] scroll in textview and problem with tab

Alexander Kuleshov kuleshovmail at gmail.com
Thu Feb 11 20:23:32 WST 2010


Hi guys. I have following problem. I have code that adds a new tab in
NoteBook with gtk.TextView and button and label to close tabs on the
tab itself. The problem is that I'm trying to add this to gtk.TextView
scroll to scroll the text with scrolled widow, but when you add the
tab appears but disappears scroll button to close the tab itself. How
can i resolve this? And Is there any way to add scrolling druie in
gtk.TextView?

Code:
 def new_tab(self):

      editor = gtk.TextView()
      scrolled_window = gtk.ScrolledWindow()

      self.add(scrolled_window)
      scrolled_window.add(editor)

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

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

      self.set_tab_label_packing(editor,False,True, gtk.PACK_START)
      self.set_tab_label(editor,label)

      label.show_all()
__________________________________
Thank you.


More information about the pygtk mailing list