One solution is to abuse scrollwindow's policy.
For example,
from gtk import *
from GTK import *
win = GtkWindow()
win.connect('destroy', mainquit)
pane = GtkHPaned()
win.add(pane)
scroll = GtkScrolledWindow()
scroll.set_policy(POLICY_NEVER, POLICY_NEVER)
pane.add(scroll)
titles = ["title1", "title2"]
clist = GtkCList(2, titles)
item = ["item1", "item2"]
for i in range(10):
clist.append(item)
scroll.add(clist)
win.show_all()
scroll.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC)
mainloop()
On Sat, 3 Jul 1999, Harry Henry Gebel wrote:
> Hi,
> I have a GtkCList that I am trying to put inside a
> GtkScrolledWindow (which is inside a GtkHPaned) When it was just the
> CList inside the HPaned automatically adjusted itself to the size of the
> CList (there is currently nothing in the other pane.) After putting the
> CList inside the ScrolledWindow the HPaned now makes itself just big
> enough to view the scroll bars and a little tiny piece of the CList, I
> presume because the ScrolledWindow does not automatically make itself
> large enough to contain the entire CList. So I figured I could just find
> out the size of the CList and manually set the size of the
> ScrolledWindow before putting it inside the HPaned, but I haven't been
> able to figure out how to find out the size of the CList. In the GTK
> referance docs there is a listing of "args" that includes "width" and
> "height" in GtkWidget, but how do access these. I found a function
> called arg_get in GtkObject, but it doesn't appear to work in pygtk
> (maybe I'm doing it wrong, I tried using GtkCList.arg_get("width") but
> got "attribute error: arg_get") How do I access these args? Or
> alteratively get the scrolled Window to start out the same size as the
> initial CList.
>
> -Harry
> To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]
>
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]