aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorDavid Jee <djee@redhat.com>2004-02-10 17:12:09 +0000
committerDavid Jee <djee@gcc.gnu.org>2004-02-10 17:12:09 +0000
commit49d77e22756fe0076f542dcb82cd434b54742c46 (patch)
treee28e2d51c2de43dd3d4f6ce0ea4a3ebcb08c76b1 /libjava
parent31cc6081778b66c7fc1d0e864fea5a73dcbd25c8 (diff)
downloadgcc-49d77e22756fe0076f542dcb82cd434b54742c46.zip
gcc-49d77e22756fe0076f542dcb82cd434b54742c46.tar.gz
gcc-49d77e22756fe0076f542dcb82cd434b54742c46.tar.bz2
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. From-SVN: r77604
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog8
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java3
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c19
3 files changed, 29 insertions, 1 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index ec29318..8134d7e 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 9a83226..cf7260c 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 e16b2d4..7f5d44a 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)
{