Search Results

Search found 5 results on 1 pages for 'scrolledwindow'.

Page 1/1 | 1 

  • Python Tkinter Tix: How to use ScrolledWindow with grid in Tix NoteBook

    - by Sano98
    Hi guys, I'm adding several widgets to a Frame which is located in a tix.NoteBook. When there are too much widgets to fit in the window, I want to use a scrollbar, so I put tix.ScrolledWindow inside that Frame and add my widgets to this ScrolledWindow instead. The problem is that when using the grid() geometry manager, the scrollbar appears, but it is not working (The drag bar occupies the whole scroll bar). from Tkinter import * import Tix class Window: def __init__(self, root): self.labelList = [] self.notebook = Tix.NoteBook(root, ipadx=3, ipady=3) self.notebook.add('sheet_1', label="Sheet 1", underline=0) self.notebook.add('sheet_2', label="Sheet 2", underline=0) self.notebook.add('sheet_3', label="Sheet 3", underline=0) self.notebook.pack() #self.notebook.grid(row=0, column=0) tab1=self.notebook.sheet_1 tab2=self.notebook.sheet_2 tab3=self.notebook.sheet_3 self.myMainContainer = Frame(tab1) self.myMainContainer.pack() #self.myMainContainer.grid(row=0, column=0) scrwin = Tix.ScrolledWindow(self.myMainContainer, scrollbar='y') scrwin.pack() #scrwin.grid(row=0, column=0) self.win = scrwin.window for i in range (100): self.labelList.append((Label(self.win))) self.labelList[-1].config(text= "Bla", relief = SUNKEN) self.labelList[-1].grid(row=i, column=0, sticky=W+E) root = Tix.Tk() myWindow = Window(root) root.mainloop() Whenever I change at least one of the geometry managers from pack() to grid(), the problem occurs. (Actually, I'd prefer using grid() for all containers.) When I don't use the NoteBook widget, the problem does not occur either. The other examples here all seem to rely on pack(). Any ideas? Many thanks, Sano

    Read the article

  • PyGTK: Trouble with size of ScrolledWindow

    - by canavanin
    Hi everyone! I am using PyGTK and the gtk.Assistant. On one page I have placed a treeview (one column, just strings) in a gtk.ScrolledWindow (I wanted the vertical scrollbar, since the list contains about 35 items). Everything is working fine; the only thing that bugs me is that I have not been able to figure out from the documentation how to set the size of the scrolled window. Currently only three items are displayed at a time; I would like to set this number to 10 or so. Below is the code. As you can see I have tried using a gtk.Adjustment to influence the scrolled window's size, but as - once more - I have been incompetent at retrieving the required info from the documentation, I don't actually know what values should be put into there. self.page7 = gtk.VBox() # The gtk.Adjustment: page_size = gtk.Adjustment(lower=10, page_size=100) # just used some arbitrary numbers here >_< scrolled_win = gtk.ScrolledWindow(page_size) scrolled_win.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) # only display scroll bars when required self.character_traits_treeview = gtk.TreeView() self.character_traits_treestore = gtk.TreeStore(str) self.character_traits_treeview.set_model(self.character_traits_treestore) tc = gtk.TreeViewColumn("Character traits") self.character_traits_treeview.append_column(tc) cr = gtk.CellRendererText() tc.pack_start(cr, True) tc.add_attribute(cr, "text", 0) self.character_trait_selection = self.character_traits_treeview.get_selection() self.character_trait_selection.connect('changed', self.check_number_of_character_trait_selections) self.character_trait_selection.set_mode(gtk.SELECTION_MULTIPLE) self.make_character_traits_treestore() # adding the treeview to the scrolled window: scrolled_win.add(self.character_traits_treeview) self.page7.pack_start(scrolled_win, False, False, 0) self.assistant.append_page(self.page7) self.assistant.set_page_title(self.page7, "Step 7: Select 2-3 character traits") self.assistant.set_page_type(self.page7, gtk.ASSISTANT_PAGE_CONTENT) self.assistant.set_page_complete(self.page7, False) def check_number_of_character_trait_selections(self, blah): # ... def make_character_traits_treestore(self): # ... I know I should RTFM, but as I can't make head or tail of it, and as further searching, too, has been to no avail, I'm just hoping that someone on here can give me a hint. Thanks a lot in advance! PS: Here are the links to: the gtk.ScrolledWindow documentation the gtk.Adjustment documentation

    Read the article

  • ScrolledWindow and wx.EVT_LEAVE_WINDOW

    - by Joril
    Hi everyone! I have a frame with a textctrl. When the mouse enters the textctrl (EVT_ENTER_WINDOW) I show a PopupWindow on top of the textctrl, and when the mouse leaves the popup (EVT_LEAVE_WINDOW) I hide it again. Everything works fine, except when inside the PopupWindow there's a ScrolledWindow with shown scrollbars. The EVT_LEAVE_WINDOW gets fired when I move the mouse on top of a scrollbar, so it looks like wxPython thinks the scrollbars are not part of the scrolledwindow.. :/ I tried binding the event to the popup or the scrollwindow itself, but nothing changes.. Is there a way I could get around this? Many thanks! (wxPython 2.8.8.0 on Xubuntu 8.10)

    Read the article

  • GTK Scolled Window - Keep Scroll Bar at bottom

    - by Bill
    I have a GTK/C++ program that uses a ScrolledWindow. I keep adding data to the list within the scrolled window, and I want to keep focus on the newest item. But I also want to allow the user to scroll through the data to select an old item. Is there a way to do this? I've looked everywhere but can't find anything.

    Read the article

  • Gtk: How can I get a part of a file in a textview with scrollbars relating to the full file

    - by badgerman1
    I'm trying to make a very large file editor (where the editor only stores a part of the buffer in memory at a time), but I'm stuck while building my textview object. Basically- I know that I have to be able to update the text view buffer dynamically, and I don't know hot to get the scrollbars to relate to the full file while the textview contains only a small buffer of the file. I've played with Gtk.Adjustment on a Gtk.ScrolledWindow and ScrollBars, but though I can extend the range of the scrollbars, they still apply to the range of the buffer and not the filesize (which I try to set via Gtk.Adjustment parameters) when I load into textview. I need to have a widget that "knows" that it is looking at a part of a file, and can load/unload buffers as necessary to view different parts of the file. So far, I believe I'll respond to the "change_view" to calculate when I'm off, or about to be off the current buffer and need to load the next, but I don't know how to get the scrollbars to have the top relate to the beginning of the file, and the bottom relate to the end of the file, rather than to the loaded buffer in textview. Any help would be greatly appreciated, thanks!

    Read the article

1