This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[PATCH] Changing the foreground color of a Checkbox
- From: David Jee <djee at redhat dot com>
- To: java-patches at gcc dot gnu dot org
- Date: 26 Jan 2004 15:19:09 -0500
- Subject: [PATCH] Changing the foreground color of a Checkbox
- Organization:
Hello,
This patch fixes the find_bg_color_widget() method in
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c. A GtkButton is
an instance of GtkBin, and it contains a GtkLabel as its only child. If
we want to modify the foreground color of this GtkButton, we should
actually modify its child's foreground color in order to have any
visible effect. This will allow us to change the foreground color of a
AWT CheckBox.
Is it ok to commit?
-David Jee
2004-01-26 David Jee <djee@redhat.com>
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
(find_bg_color_widget): For GtkButton, return its child.
Index: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
===================================================================
RCS file: /cvs/gcc/gcc/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c,v
retrieving revision 1.12
diff -u -r1.12 gnu_java_awt_peer_gtk_GtkComponentPeer.c
--- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c 5 Jan 2004 21:13:46 -0000 1.12
+++ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c 26 Jan 2004 20:06:04 -0000
@@ -621,7 +621,7 @@
{
GtkWidget *fg_color_widget;
- if (GTK_IS_EVENT_BOX (widget))
+ if (GTK_IS_EVENT_BOX (widget) || GTK_IS_BUTTON (widget))
fg_color_widget = gtk_bin_get_child (GTK_BIN(widget));
else
fg_color_widget = widget;