Re: Gtk color API



Hi,

This question belongs to gtk-list (place where you can discuss about
using GTK+ toolkit).

Anyway, please read the documentation about gtk_widget_modify_bg, it
directly answers your question.

-Markku-

On Sat, 2008-03-29 at 03:14 -0500, nisha jain wrote:
> Hi All,
>  
> I have requirement of making boxes filled with colors without any
> functionality.
> To acheive this i am using the labels and trying to fill them with
> colors
>  as doing it with other widgets i am not able to figure out... 
>  
> I am using following code to acheive it but i am not getting any
> output...
>  
>  
> GtkWidgets *labels[2];
> GtkWidget color;
>  
>  for(i = 0; i<2; i++)
>  {
>   labels[i] = gtk_label_new("");
>  }
>  gdk_color_parse("red", &color);
>  gtk_widget_modify_bg(GTK_WIDGET(labels[0]), GTK_STATE_NORMAL,
> &color);
>  gdk_color_parse("green", &color);
>  gtk_widget_modify_bg(GTK_WIDGET(labels[1]), GTK_STATE_NORMAL,
> &color);
> 
> 
>  I am trying to pack these in a box but that is not working though i
> am not getting any errors.
> 
> Please let me know if some one has similar functionality in any
> application? How i can acheive this?
> 
>  
> 
> Regards,
> 
> Nisha
> 
>  
> 
> 
> _______________________________________________
> gtk-devel-list mailing list
> gtk-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-devel-list



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