[pygtk-0.7.0, python-1.6a2, gtk-1.2.7, Suse Linux 6.1, kernel 2.2.11]
I'm trying to use the layout widget inside a scrolledwindow.
The scrolling doesn't work the way I think it's supposed to:
----------------------------------------------------------------------
from gtk import *
topwin = GtkWindow(WINDOW_TOPLEVEL)
#topwin.set_usize(600, 450)
mainvbox = GtkVBox(FALSE, 0)
topwin.add(mainvbox)
swin = GtkScrolledWindow()
swin.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC)
mainvbox.pack_start(swin)
layout = GtkLayout(swin.get_hadjustment(),swin.get_vadjustment())
layout.get_vadjustment().step_increment = 50
layout.get_hadjustment().step_increment = 50
swin.add(layout)
testlab = GtkLabel('the rain in spain')
for i in range(1, 800, 20): # place 50 lines in layout
layout.put(GtkLabel('testing label in layout'), 5, i)
layout.set_size(300,800)
topwin.show_all()
main()
----------------------------------------------------------------------
The window starts out tiny (since I didn't set_usize at all) with
scrollbars, but when I pull it larger, it only shows scrollbars when
the window size is smaller than around 50 pixels. But the data in the
layout window is around 800 pixels high, as I see by stretching the
window that big. Maybe there's something wrong with the way I'm
handling vadjustments?
When I "set_usize(600, 450)", I can't get scrollbars at all.
If I do layout.set_size, I do get scrolling, but an oddly varying
sized portion of the bottom comes out black.
My reason for using the layout widget is that I have a large amount of data
which when fully displayed may be higher than the xlib limit of 32k pixels.
Thanks,
George
George Young, Rm. L-204 [EMAIL PROTECTED]
MIT Lincoln Laboratory
244 Wood St.
Lexington, Massachusetts 02420-9108 (781) 981-2756
-
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]