Re: Setting a color of a CList row/column on particular colums/rows

From: Date: Wed, 17 Oct 2001 03:02:29 +0000
Subject: Re: Setting a color of a CList row/column on particular colums/rows
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-299@lists.php.net to get a copy of this message
there is some examples in the gtk.php in samples. somebody correct me if I wrong on this.. the basic prinicple of modifying color of most things in gtk is. each object/widget has a gtkstyle, obtained by $current_style=$widget->get_style(); one you have this style, you should make a copy. $new_style = $current_style->copy(); now you have a new style. you can change some of the properties. $new_style->bg[GTK_STATE_NORMAL]=new GdkColor("#FF0000"); // (rgb) where bg could be base,fg,mid.... for the full list have a look at http://developer.gnome.org/doc/API/gtk/gtk-styles.html#GTKSTYLE for the STATE bit look at http://developer.gnome.org/doc/API/gtk/gtk-standard-enumerations.html#GTKSTATETYPE this is a snippet from my preferences tab - where it sets the background color of a gtkdrawable.
        $w = "btn_".$widgetname;
// $this->$w will return a gtkdrawable.
       $current_style=$this->$w->get_style();
       $new_style = $current_style->copy();
       $new_style->bg[GTK_STATE_NORMAL]=new GdkColor($setting);
       $this->$w->set_style($new_style);
note: you cannot change the background color of 'labels', and buttons are near impossible to change the color of. regards alan PQ Administrator wrote:
How can I set the color of a certain column or row in a CList.... for instance if Im comparing two sets of data and 1 field from one set doesnt match the other set.... how do I set a color to highlight that field? Thanks in advance... /*Troy McComas Networks/System Admin. PhysicianQuest.com <http://www.physicianquest.com> E-Mail Me! <mailto:admin@physicianquest.com> Office - (818)550-8777 Cell- (626)255-9833 */ ------------------------------------------------------------------------ /*/ Powered by / PhysicianQuest.com <http://www.physicianquest.com> <http://mail.physicianquest.net:80/cgi-auth/mailrcpt.cgi?userid=pqadmin&maildomainname=physicianquest.net&msgid=20011016.AAA1003284042@physicianquest.net> */


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