On Sat, 22 Jul 2000 11:29:48 -0700, "Scott F. Johnston" <[EMAIL PROTECTED]> 
wrote:
> I would like to have more than one window scroll using one scrollbar.
> 
> I can create multiple ScrolledWindows, and gang the adjustments together
> to get the behavior I want, but this leaves extra scrollbars on-screen.
> If I set the policy of the extra window's scrollbars to "NEVER" I get
> rid of the scrollbars I want, but scrolling is disabled.
> 
> The behavior I want is similar to a spreadsheet, where the top row and
> left column remain visible at all times. (And the Sheet widget is not
> appropriate for this app.)
> 
> TIA,
> 
> Scott
> 
> _______________________________________________
> pygtk mailing list   [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk
> 
> 

Maybe you disabled the wrong window.  The following works:

#!/usr/bin/python
from gtk import *

def fill_with_buttons (scrolled_win):
        vbox = GtkVBox ()
        scrolled_win.add_with_viewport (vbox)
        for i in range(100):
                button = GtkButton ("button %d" % i)
                button.set_usize (400, 20)
                vbox.pack_start (button)

def make_scrolled_win (title="", hadjustment=None, vadjustment=None):
        win = GtkWindow ()
        win.set_title (title)
        win.connect ("destroy", mainquit)
        win.set_usize (300, 300)
        scrolled_win = GtkScrolledWindow (hadjustment, vadjustment)
        win.add (scrolled_win)
        fill_with_buttons (scrolled_win)
        win.show_all ()
        return scrolled_win

sw1 = make_scrolled_win ("1")
sw2 = make_scrolled_win ("2", sw1.get_hadjustment(), sw1.get_vadjustment())
sw2.set_policy (POLICY_NEVER, POLICY_NEVER)

mainloop ()


_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to