/[classpath]/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c
ViewVC logotype

Diff of /classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by tromey, Sat Nov 9 23:17:30 2002 UTC revision 1.5 by tromey, Wed Feb 19 03:50:33 2003 UTC
# Line 148  Java_gnu_java_awt_peer_gtk_GtkTextFieldP Line 148  Java_gnu_java_awt_peer_gtk_GtkTextFieldP
148    
149    gdk_threads_leave ();    gdk_threads_leave ();
150  }  }
151    
152    JNIEXPORT void JNICALL
153    Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_gtkSetFont
154      (JNIEnv *env, jobject obj, jstring jname, jint size)
155    {
156      const char *xlfd;
157    # define FBUFSZ 200
158      char buf[FBUFSZ];
159      void *ptr;
160      GdkFont * new_font;
161      GtkStyle * style;
162      GtkWidget * text;
163    
164      ptr = NSA_GET_PTR (env, obj);
165      text = GTK_WIDGET (ptr);
166      
167      xlfd = (*env)->GetStringUTFChars (env, jname, NULL);
168      snprintf(buf, FBUFSZ, xlfd, size);
169      (*env)->ReleaseStringUTFChars (env, jname, xlfd);
170      gdk_threads_enter();
171      new_font = gdk_font_load(buf);  /* FIXME: deprecated. Replacement?    */
172      if (new_font == NULL)
173        {
174          /* Fail quietly for now. */
175          gdk_threads_leave();
176          return;
177        }
178      style = gtk_style_copy (gtk_widget_get_style (text));
179      style -> font = new_font;
180      gtk_widget_set_style (text , style);
181      /* FIXME: Documentation varies as to whether we should unref style. */
182      gdk_threads_leave();
183    }

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26