RE: [PHP-GTK] RE: Changing color/style on a scrollbar inaGtkScrolledWindow

From: Date: Sat, 31 Jul 2004 23:03:52 +0000
Subject: RE: [PHP-GTK] RE: Changing color/style on a scrollbar inaGtkScrolledWindow
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-4906@lists.php.net to get a copy of this message
set_row_style() definitely isn't about to work for a gtkvscrollbar :I Madeleine is correct, though - style is a gtkwidget property, and a gtkadjustment is _not_ a gtkwidget, but part of the gtkdata family (no screen space taken). But even when you have the right widget (gtkvscrollbar), you'll find that there's no way to reach the scrollbars themselves because the widget's own component parts aren't exposed; you need to set the style on the scrolled window widget. Horribly gory demonstration coming up: $style = $swin->style; $red = new GdkColor('#FF0000'); $green = new GdkColor('#00FF00'); $blue = new GdkColor('#0000FF'); $style->bg[GTK_STATE_NORMAL] = $red; $style->bg[GTK_STATE_PRELIGHT] = $green; //slider hover $style->bg[GTK_STATE_ACTIVE] = $blue; //trough $swin->set_style($style); Depending on the child widget(s) your scrolled window is holding, you may need to set style properties on the child to override the style's propogation. http://gtk.php.net/manual/en/gtk.gtkstyle.php might help some too.. - Steph > -----Original Message----- > From: Madeleine D. [mailto:mmdrake@bctonline.com] > Sent: 30 July 2004 22:17 > To: php-gtk-general@lists.php.net > Subject: Re: [PHP-GTK] RE: Changing color/style on a scrollbar > inaGtkScrolledWindow > > > Dave - > > I'm not sure you can do what you're attempting. > > It looks to me as though style has to be applied to a widget, and > vadjustment is described as an object in the Gtk docs. If I'm right, it > makes sense that it wouldn't accept a set_style. > > I can give you a quick example of the kind of style setting that > has worked > for us - a clist row highlight. It might lead you to what you > need for the > Scroll Window: > > function PMformatRowStyle($clist,$count) { > $color1 = &new GdkColor('#000000'); > $color2 = &new GdkColor('#ffe4c4'); > > $style = &new GtkStyle; > $style->fg[GTK_STATE_NORMAL] = $color1; > $style->base[GTK_STATE_NORMAL] = $color2; > $style->font = > gdk::font_load("-adobe-tahoma-medium-r-normal--*-120-*-*-*-*-*-*,*"); > > $clist->set_row_style($count,$style); > > } // end format row function > > > My experience with style has been fairly brutal - it never really > does what > we think it should - so maybe I'm off base here, in which case one of the > real experts can step in. > > Madeleine D. > > -- > PHP-GTK General Mailing List (http://gtk.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.gtk.general (#4906) next »