RE: [PHP-GTK] RE: Changing color/style on ascrollbarinaGtkScrolledWindow
| From: | Steph | Date: | Tue, 03 Aug 2004 00:08:56 +0000 |
| Subject: | RE: [PHP-GTK] RE: Changing color/style on ascrollbarinaGtkScrolledWindow | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-4922@lists.php.net to get a copy of this message | ||
That's actually not a PHP-GTK issue; the rc call rolls on set_style() rather
than on the specialised style methods that are in place for clist and
similar.
Haven't investigated GTK 2.4 yet and have next to no clue what's in store
there :) I'll catch up when I can.
> -----Original Message-----
> From: Madeleine D. [mailto:mmdrake@bctonline.com]
> Sent: 02 August 2004 22:31
> To: php-gtk-general@lists.php.net
> Subject: RE: [PHP-GTK] RE: Changing color/style on
> ascrollbarinaGtkScrolledWindow
>
>
> Steph -
>
> Thanks for the explanation; it makes sense, given the behavior we've seen
> in our app.
>
> We went to the gtk-rc a long time ago, and it works great for the majority
> of our needs. But, we still have instances where we need style to work on
> an individual widget - like the Clist row highlight. One time, special
> requirement, dependent on certain circumstances with the data, not really
> covered by the rc.
>
> It would be great if this kind of thing was doable in PHP-Gtk2.
>
> Madeleine D.
>
>
> At 08:45 PM 8/2/2004 +0100, Steph wrote:
> >Hi Madeleine,
> >
> >Sorry, Dave and I went off-list there. I gave him a simple
> >gtkscrolledwindow script with the code below, and it worked fine
> on his box
> >too; ergo, we don't have a platform issue.
> >
> >I think that when you create larger and more complex applications you're
> >most likely seeing a drop-through effect that means the style property
> >you're retrieving from the widget actually contains the style
> properties of
> >the outermost parent widget. In that case 'style->bg' wouldn't
> necessarily
> >mean a thing to GTK, because the child widget's natural-born
> style element
> >isn't the one being accessed.
> >
> >They call it propagation.. and I could be spelling that wrong :)
> >
> >It's never affected me because I've never actually tried to apply styles
> >across a big application. However, I suspect that a far better
> way to deal
> >with style when you have something complex to deal with would be
> by taking
> >the rc file route. See Andrei's ancient but trusty test/gtk.php
> and friends
> >for details.
> >
> >- Steph
> >
> >> -----Original Message-----
> >> From: Madeleine D. [mailto:mmdrake@bctonline.com]
> >> Sent: 02 August 2004 19:13
> >> To: php-gtk-general@lists.php.net
> >> Subject: RE: [PHP-GTK] RE: Changing color/style on
> >> ascrollbarinaGtkScrolledWindow
> >>
> >>
> >> Steph -
> >>
> >> I'm using Win98, and I don't see any effect from this code at all. It
> >> doesn't blow up on us, the way some of our other attempts at
> >> style have; it
> >> just doesn't change our scroll window at all.
> >>
> >> What could I be missing?
> >>
> >> Madeleine D.
> >>
> >>
> >> At 05:52 PM 8/2/2004 +0100, you wrote:
> >> >Weird. It worked for me under win98.
> >> > -----Original Message-----
> >> > From: dpgirago@mdanderson.org [mailto:dpgirago@mdanderson.org]
> >> > Sent: 02 August 2004 17:37
> >> > To: php-gtk-general@lists.php.net; steph@zend.com;
> >> mmdrake@bctonline.com;
> >> >malko@the-ring.homelinux.net
> >> > Subject: Re: [PHP-GTK] RE: Changing color/style on a
> >> >scrollbarinaGtkScrolledWindow
> >> >
> >> >
> >> >
> >> > Steph,Madeleine, Malko, thanks very much for your input.
> >> >
> >> > I originally tried to get the style from the GtkScrolledWindow
> >> widget, and
> >> >then tried to set it just as you showed in your example, Steff.
> >> >
> >> > > $style = $scrolledWin->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
> >> > > $scrolledWin->set_style($style);
> >> >
> >> > Unfortunately, as Madeleine suggests, this does not give
> the expected
> >> >results. In fact, the results were so confounding that I
> abandoned this
> >> >approach and only then pursued the vadjustment thingy.
> >> >
> >> > But I did re-review the manual page for GtkStyle(), and by
> >> using -- $style
> >> >= gtk::widget_get_default_style() --
> >> > I was able to change the background color for the entire window,
> >> >scrollbars, clist column headers, etc... So success was
> >> evetually achieved
> >> >;~)
> >> >
> >> > Although I don't want to prolong what seems to be a less
> than thrilling
> >> >thread, I am curious as to whether others have been able use
> >> something like
> >> >Steph's example to specifically change colors of scrollbars and
> >> clist column
> >> >headers. It simply didn't work for me. As I'm on Win2k, I
> can't help but
> >> >wonder whether this might be a consideration, cross-platform
> >> functionality
> >> >notwithstanding.
> >> >
> >> > I will add a comment to the Wiki about my experience.
> >> >
> >> > Thanks, again, everyone.
> >> >
> >> > dave
> >> >
> >>
> >> --
> >> PHP-GTK General Mailing List (http://gtk.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >
> >
>
> --
> PHP-GTK General Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>