Re: [gtk-list] How do I get r,g,b from gdk_gc_get_values?
- From: Rob Browning <rlb cs utexas edu>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] How do I get r,g,b from gdk_gc_get_values?
- Date: 26 Jan 1998 00:12:06 -0600
I think I figured out the answer (at least it seems to work). Please
let me know if this is wrong. Also, do I need any other
"free/unref's" here?
GdkGCValues gcv;
GdkVisual *visual = gtk_widget_get_visual(GTK_WIDGET(w));
GdkColormap *cmap = gtk_widget_get_colormap(GTK_WIDGET(w));
GdkColorContext *cc = gdk_color_context_new(visual, cmap);
GdkColor fg;
gdk_gc_get_values(gc, &gcv);
fg.pixel = gc.foreground.pixel;
gdk_color_context_query_color(cc, &fg);
gdk_color_context_free(cc);
cc = NULL:
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]