[Glade-users] background on label



--------------070206060509080504090109
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Thanks a lot... I'll try it out.... guess I didn't see it or just forgot 
about it in the FAQ....


Damon Chaplin wrote:

"Dennis L. Goyette Sr." wrote:

anyway to change the background color on a label widget????


This is covered in the FAQ:

2.2 How do I change the colors of a widget, e.g. make a label red?

You can use standard GTK+ rc files to set the colors & fonts of your
widgets.
If you turn on the 'Set Widget Names' project option in Glade, that may
make
it easier to refer to your widgets, as you can refer to them by name.
See the GTK+ Resource Files documentation at
http://developer.gnome.org/doc/API

You can also change a widget's style within your code by calling
gtk_widget_modify_style(), e.g.

  GdkColor red = { 0, 65535, 0, 0 };
  GtkRcStyle *rc_style = gtk_rc_style_new ();
  rc_style->fg[GTK_STATE_NORMAL] = red;
  rc_style->color_flags[GTK_STATE_NORMAL] |= GTK_RC_FG;
  gtk_widget_modify_style (widget, rc_style);
  gtk_rc_style_unref (rc_style);



Note that labels do not draw their own background, so you may need to
place it in a GtkEventBox and set the background of that instead.

Damon






--------------070206060509080504090109
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<html><head></head><body>Thanks a lot... I'll try it out.... guess I didn't see it or just forgot about it in 
the FAQ....<br>
<br>
<br>
Damon Chaplin wrote:<br>
<blockquote type="cite" cite="mid:Pine LNX 4 21 0102251342030 22087-100000 trna ximian com"><pre 
wrap="">"Dennis L. Goyette Sr." wrote:<br></pre>
  <blockquote type="cite"><pre wrap="">anyway to change the background color on a label 
widget????<br></pre></blockquote>
    <pre wrap=""><!----><br>This is covered in the FAQ:<br><br>2.2 How do I change the colors of a widget, 
e.g. make a label red?<br><br>You can use standard GTK+ rc files to set the colors &amp; fonts of 
your<br>widgets.<br>If you turn on the 'Set Widget Names' project option in Glade, that may<br>make<br>it 
easier to refer to your widgets, as you can refer to them by name.<br>See the GTK+ Resource Files 
documentation at<br><a class="moz-txt-link-freetext" 
href="http://developer.gnome.org/doc/API";>http://developer.gnome.org/doc/API</a><br><br>You can also change a 
widget's style within your code by calling<br>gtk_widget_modify_style(), e.g.<br><br>  GdkColor red = { 0, 
65535, 0, 0 };<br>  GtkRcStyle *rc_style = gtk_rc_style_new ();<br>  rc_style-&gt;fg[GTK_STATE_NORMAL] = 
red;<br>  rc_style-&gt;color_flags[GTK_STATE_NORMAL] |= GTK_RC_FG;<br>  gtk_widget_modify_style (widget, 
rc_style);<br>  gtk_rc_style_unref (rc_style);<br><br><br><br>Note that labels do not draw their own 
background, so you may need to<br>place it in a GtkEventBox and set the background of that 
instead.<br><br>Damon<br><br><br><br><br></pre>
    </blockquote>
    <br>
</body></html>
--------------070206060509080504090109--






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]