diff options
author | djee <djee@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-02-10 17:12:09 +0000 |
---|---|---|
committer | djee <djee@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-02-10 17:12:09 +0000 |
commit | f43aa01a1389a484e95192db909f5f21a162241c (patch) | |
tree | e28e2d51c2de43dd3d4f6ce0ea4a3ebcb08c76b1 /libjava | |
parent | 3bcc1a800100c83e84eaa18ef50c68510a8d8cd1 (diff) | |
download | gcc-f43aa01a1389a484e95192db909f5f21a162241c.tar.gz |
2004-02-10 David Jee <djee@redhat.com>
* gnu/java/awt/peer/gtk/GtkButtonPeer.java
(gtkSetLabel): New native method definition.
(setLabel): Use gtkSetLabel.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
(Java_gnu_java_awt_peer_gtk_GtkButtonPeer_gtkSetLabel): New method.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77604 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 8 | ||||
-rw-r--r-- | libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java | 3 | ||||
-rw-r--r-- | libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c | 19 |
3 files changed, 29 insertions, 1 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index ec293183985..8134d7ea4ba 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,11 @@ +2004-02-10 David Jee <djee@redhat.com> + + * gnu/java/awt/peer/gtk/GtkButtonPeer.java + (gtkSetLabel): New native method definition. + (setLabel): Use gtkSetLabel. + * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c + (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_gtkSetLabel): New method. + 2004-02-10 Alan Modra <amodra@bigpond.net.au> * include/powerpc-signal.h: Revert 2004-01-21 change. diff --git a/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java index 9a832265b34..cf7260c1179 100644 --- a/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java +++ b/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java @@ -54,6 +54,7 @@ public class GtkButtonPeer extends GtkComponentPeer public native void connectSignals (); native void gtkSetFont(String name, int style, int size); + native void gtkSetLabel(String label); native void gtkWidgetSetForeground (int red, int green, int blue); public GtkButtonPeer (Button b) @@ -63,7 +64,7 @@ public class GtkButtonPeer extends GtkComponentPeer public void setLabel (String label) { - set ("label", label); + gtkSetLabel(label); } public void handleEvent (AWTEvent e) diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c index e16b2d457d6..7f5d44a2d7c 100644 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c @@ -88,6 +88,25 @@ Java_gnu_java_awt_peer_gtk_GtkButtonPeer_connectSignals } JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_GtkButtonPeer_gtkSetLabel + (JNIEnv *env, jobject obj, jstring jtext) +{ + const char *text; + GtkWidget *label; + void *ptr; + + ptr = NSA_GET_PTR (env, obj); + label = gtk_bin_get_child (GTK_BIN(ptr)); + text = (*env)->GetStringUTFChars (env, jtext, NULL); + + gdk_threads_enter (); + gtk_label_set_text (GTK_LABEL(label), text); + gdk_threads_leave (); + + (*env)->ReleaseStringUTFChars (env, jtext, text); +} + +JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkButtonPeer_gtkSetFont (JNIEnv *env, jobject obj, jstring name, jint style, jint size) { |