Re: [gtk-list] Setting Widget Attributes (Half Solution)
- From: "Adrian E. Feiguin" <adrian ifir ifir edu ar>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Setting Widget Attributes (Half Solution)
- Date: Tue, 2 Jun 1998 14:39:16 -0400 (EDT)
> --------------------------------------------------------
> GtkWidget *label = NULL;
> GtkStyle *LabelStyle = NULL;
> GdkColor *fg = NULL;
> GdkColor *bg = NULL;
>
> label = gtk_label_new("Text");
> LabelStyle = gtk_style_copy(gtk_widget_get_style(label);
> gtk_widget_set_style(label,LabelStyle);
>
> fg = (GdkColor *) malloc(sizeof(GdkColor));
> bg = (GdkColor *) malloc(sizeof(GdkColor));
>
> foreGroundColor->red = 0;
> foreGroundColor->green = 200 * (65535/255);
> foreGroundColor->blue = 0;
>
> backGroundColor->red = 0;
> backGroundColor->green = 0;
> backGroundColor->blue = 0;
>
> LabelStyle->fg[0] = *foreGroundColor;
> LabelStyle->bg[0] = *backGroundColor;
Maybe the right way to do it is:
gdk_gc_set_foreground(label->fg_gc , foreGroundColor);
gdk_gc_set_foreground(label->bg_gc , backGroundColor);
Please, correct me if I'm wrong (or if it works), thanks,
<ADRIAN>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]