classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] support Save file dialogs in GTK peers


From: Mark Wielaard
Subject: Re: [cp-patches] support Save file dialogs in GTK peers
Date: Fri, 26 Aug 2005 17:22:00 +0200

Hi,

On Fri, 2005-08-26 at 00:35 -0400, Thomas Fitzsimmons wrote:
> This patch adds support for Save file dialogs in the GTK peers.

> +  else
> +    {
> +      widget = gtk_file_chooser_dialog_new
> +        ("Save File",
> +         GTK_WINDOW(parentp),
> +         GTK_FILE_CHOOSER_ACTION_SAVE,
> +         GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
> +         GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
> +         NULL);
> +      gtk_file_chooser_set_do_overwrite_confirmation
> +        (GTK_FILE_CHOOSER (widget), TRUE);
> +    }

That is new 2.8 functionality. I don't think we should unconditionally
depend on that.


> +Java_gnu_java_awt_peer_gtk_GtkWindowPeer_setVisibleNative
> +  (JNIEnv *env, jobject obj, jboolean visible)
> +{
> +  gdk_threads_enter ();
> +
> +  Java_gnu_java_awt_peer_gtk_GtkWindowPeer_setVisibleNativeUnlocked
> +    (env, obj, visible);
> +
> +  gdk_threads_leave ();
> +}
> +
> +JNIEXPORT void JNICALL
> +Java_gnu_java_awt_peer_gtk_GtkWindowPeer_setVisibleNativeUnlocked
> +  (JNIEnv *env, jobject obj, jboolean visible)
> +{
> +  void *ptr;
> +
> +  ptr = NSA_GET_PTR (env, obj);
> +
> +  if (visible)
> +    gtk_widget_show (GTK_WIDGET (ptr));
> +  else
> +    gtk_widget_hide (GTK_WIDGET (ptr));
> +
> +  gdk_flush ();
> +}

Is the gdk_flush () really needed in the Unlocked case?
I think you only need that just before the gdk_threads_leave ().

Cheers,

Mark

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]