OK, that's it. The question "how do I set the color of a widget?" just
appeared on gtk-list or gtk-app-devel-list for what must be the literal
two hundreth time. As Raph points out, clearly it must be too hard to do

Can we add an API, maybe:
 gtk_widget_set_color(GtkWidget*   widget,
                      GtkPaletteType  pal,  /* fg, bg, light, base */
                      GtkStateType  state,
                      GdkColor*     color); /* allocated color */

The exact form it takes is not important, as long as it's called
gtk_widget_set_color() so people can find the thing. It should
g_return_if_fail() if you set the background on a no-window widget, and
ideally would complain about unallocated colors even.

Also a gtk_widget_set_color_rgb() variant that took RGB args and alloced
the color might be nice.

"How do I get and set the size of a widget?" will remain as a close
competitor for FAQ-I-am-totally-sick-of-answering but I can't think of a
nice API to add for that. :-)


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