[pygtk] Couple of questions about IconView

Danny Milosavljevic danny.milo at gmx.net
Sat Apr 22 05:33:20 WST 2006


Hi,

Am Freitag, den 21.04.2006, 23:15 +0300 schrieb Teemu Harju:
> Hi,
> 
> I'm kind of new with PyGtk and I've had some problems with IconView.
> 
> First of all. I'm trying to use IconView inside a ScrolledWindow, but
> it does not seem to work. I mean the scrollbar does not appear even
> though the icons don't fit to the screen. I can scroll down the icons
> with arrow keys, but I'd like to use the scrollbar. 
> 
> Secondly, how can I change the style properties of the selection box
> in IconView? I mean there are these "stype properties" listed in the
> class reference, but how do I ghange them? For example the
> "selection-box-alpha". 

In the theme ("gtk-2.0" subdirectory in used theme directory) or in
~/.gtkrc-2.0 .


like,

style "foo" {
	GtkIconView::selection_box_alpha = whatever
}

widget_class "GtkIconView" style "foo"


> Here is a clip of how I've put the IconView inside the
> ScrolledWindow...
> 
> scrolledWindow = gtk.ScrolledWindow()
> scrolledWindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
> ...
> iconView = gtk.IconView (model)
> ...
> scrolledWindow.add_with_viewport(iconView)
> 
Use .add, not .add_with_viewport .

cheers,
  Danny




More information about the pygtk mailing list