LinuxSA Mailing list archives
Index:
[thread]
[date]
[subject]
[author]
[stats]
From: Alan Kennington <ak1.linuxsa@topology.org>
To : LinuxSA <linuxsa@linuxsa.org.au>
Date: Fri, 25 Jul 2003 17:21:46 +0930
GTK+ question: how to set the colour of a button
After a couple of days of searching the GTK+ documentation,
online tutorials, API references, source files and a fairly comprehensive
book on the subject, and having tried various approaches in my C code and
failed, I'm wondering if anyone can help me with this question:
How do I set the background colour of a GTK button?
Or a GTK label? Or any other GTK widget?
For a GTK drawing area, this sort of C code works:
GtkWidget* widget1 = gtk_drawing_area_new();
gtk_widget_realize(widget1);
gdk_window_set_background(widget1->window, &col_white);
where col_white is an allocated GtkColor object.
But none of the other widget types accepts equivalent colour settings.
The corresponding code for other widget types compiles and runs, but
has no effect.
My little self-educational program is here:
http://www.topology.org/src/gtk/
By comparison, everything that is difficult in GTK+ is a total breeze
in Perl/Tk. But Perl/Tk is just too slow (for realtime applications!!!).
Since colour-setting (and everything else) is so easy in Perl/Tk (and so
well-documented), I'm kind of peeved that GTK+ is such a struggle.
I'm using version 1.2.3 currently.
I'm sure that I'll find the answers within a week, but I'd much better
spend the week on productive work.
Hopefully someone out there just happens to know the answer already.
Cheers in advance,
Alan.
--
LinuxSA WWW: http://www.linuxsa.org.au/ IRC: #linuxsa on irc.freenode.net
To unsubscribe from the LinuxSA list:
mail linuxsa-request@linuxsa.org.au with "unsubscribe" as the subject
Index:
[thread]
[date]
[subject]
[author]
[stats]
Return to the LinuxSA Mailing List Information Page