Problem with ColorContexts
- From: Rob Browning <rlb cs utexas edu>
- To: gtk-list <gtk-list redhat com>
- Subject: Problem with ColorContexts
- Date: 12 Mar 1998 12:33:34 -0600
I'm just trying to set the colors of some clist rows, but the
setting's being ignored. I'm using Gtk 0.99.5, and here's how I
allocate the color:
static int
allocate_colors() {
if(!color_context) {
gint failure;
color_context =
gdk_color_context_new(gtk_widget_get_visual(main_window),
gtk_widget_get_colormap(main_window));
assert(color_context);
split_row_color.red = 44730 >> 8;
split_row_color.green = 53052 >> 8;
split_row_color.blue = 65535 >> 8;
/* Color Contexts used to seem to want 0-255, not 0-65535
But neither works now...
split_row_color.red = 44730;
split_row_color.green = 53052;
split_row_color.blue = 65535;
*/
split_row_color.pixel = gdk_color_context_get_pixel(color_context,
split_row_color.red,
split_row_color.green,
split_row_color.blue,
&failure);
assert(!failure);
}
return(0);
}
And I try to use the color like this:
gint new_row = gtk_clist_append(GTK_CLIST(clist), rowstrs);
gtk_clist_set_background(GTK_CLIST(clist), new_row, &split_row_color);
Thanks
--
Rob Browning <rlb@cs.utexas.edu>
PGP fingerprint = E8 0E 0D 04 F5 21 A0 94 53 2B 97 F5 D6 4E 39 30
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]