Re: Newbie question - colors
- From: John Cupitt <john cupitt ng-london org uk>
- To: "Aubury, Mike" <Mike Aubury astrazeneca com>
- Cc: "Gtk-List (E-mail)" <gtk-list gnome org>
- Subject: Re: Newbie question - colors
- Date: Tue, 22 May 2001 12:53:04 +0100
"Aubury, Mike" wrote:
> DISPLAY "Hello World" TO somewidget ATTRIBUTE(RED)
>
> So I need to set the foreground colour of the 'somewidget' to red (assume
> for the sake of argument that I'm using an Entry type field here).
>
> In addition - in the definition of the form, I need to define what colour is
> used when text is input into an entry field.
>
> Any simple examples ?
Hi Mike, I think this is the approved technique:
rc_style = gtk_rc_style_new ();
rc_style->bg[GTK_STATE_NORMAL].red = 65535;
rc_style->bg[GTK_STATE_NORMAL].green = 0;
rc_style->bg[GTK_STATE_NORMAL].blue = 0;
rc_style->color_flags[GTK_STATE_NORMAL] = GTK_RC_BG;
gtk_widget_modify_style (drawing_area, rc_style);
gtk_rc_style_unref (rc_style);
(cut from an old mail from Havok) ... this is to set the background,
make the obvious changes to modify the fg. You can change font/etc. in
the same way.
HTH, John
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]