g_strdup() the text retrived from GtkEntry. only intercept the Tab key if

Sat May 16 09:04:32 1998  Tim Janik  <timj@gtk.org>

        * gtk/gtkfilesel.c (gtk_file_selection_key_press): g_strdup() the
        text retrived from GtkEntry. only intercept the Tab key if there
        was some text to complete.
This commit is contained in:
Tim Janik 1998-05-16 07:22:00 +00:00 committed by Tim Janik
parent dc93f21ffe
commit 5aa450f97b
9 changed files with 55 additions and 2 deletions

View File

@ -1,3 +1,9 @@
Sat May 16 09:04:32 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfilesel.c (gtk_file_selection_key_press): g_strdup() the
text retrived from GtkEntry. only intercept the Tab key if there
was some text to complete.
Fri May 15 21:16:54 1998 Owen Taylor <otaylor@gtk.org>
Basic thread-awareness:

View File

@ -1,3 +1,9 @@
Sat May 16 09:04:32 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfilesel.c (gtk_file_selection_key_press): g_strdup() the
text retrived from GtkEntry. only intercept the Tab key if there
was some text to complete.
Fri May 15 21:16:54 1998 Owen Taylor <otaylor@gtk.org>
Basic thread-awareness:

View File

@ -1,3 +1,9 @@
Sat May 16 09:04:32 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfilesel.c (gtk_file_selection_key_press): g_strdup() the
text retrived from GtkEntry. only intercept the Tab key if there
was some text to complete.
Fri May 15 21:16:54 1998 Owen Taylor <otaylor@gtk.org>
Basic thread-awareness:

View File

@ -1,3 +1,9 @@
Sat May 16 09:04:32 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfilesel.c (gtk_file_selection_key_press): g_strdup() the
text retrived from GtkEntry. only intercept the Tab key if there
was some text to complete.
Fri May 15 21:16:54 1998 Owen Taylor <otaylor@gtk.org>
Basic thread-awareness:

View File

@ -1,3 +1,9 @@
Sat May 16 09:04:32 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfilesel.c (gtk_file_selection_key_press): g_strdup() the
text retrived from GtkEntry. only intercept the Tab key if there
was some text to complete.
Fri May 15 21:16:54 1998 Owen Taylor <otaylor@gtk.org>
Basic thread-awareness:

View File

@ -1,3 +1,9 @@
Sat May 16 09:04:32 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfilesel.c (gtk_file_selection_key_press): g_strdup() the
text retrived from GtkEntry. only intercept the Tab key if there
was some text to complete.
Fri May 15 21:16:54 1998 Owen Taylor <otaylor@gtk.org>
Basic thread-awareness:

View File

@ -1,3 +1,9 @@
Sat May 16 09:04:32 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfilesel.c (gtk_file_selection_key_press): g_strdup() the
text retrived from GtkEntry. only intercept the Tab key if there
was some text to complete.
Fri May 15 21:16:54 1998 Owen Taylor <otaylor@gtk.org>
Basic thread-awareness:

View File

@ -27,6 +27,7 @@
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h> /* needed for sys/stat.h */
#include <sys/stat.h>
#include "glib.h"

View File

@ -1029,13 +1029,23 @@ gtk_file_selection_key_press (GtkWidget *widget,
if (event->keyval == GDK_Tab)
{
gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event");
gboolean intercept;
fs = GTK_FILE_SELECTION (user_data);
text = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry));
intercept = text && *text;
text = g_strdup (text);
gtk_file_selection_populate (fs, text, TRUE);
return TRUE;
g_free (text);
if (intercept)
gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event");
return intercept;
}
return FALSE;