Re: hiding file selections?




Okay, since nobody has responded to my post from some days ago, here's
a simple test program to demonstrate the issue I discovered.

Compile:

gcc gtk-filesel-hide-bug.c `gtk-config --cflags` `gtk-config --libs`

then start ./a.out, select a file in the filesel by double-clicking
(NOT by hitting the OK button), then see how the button in the
main-window has become irresponsive. This would have not occured with
gtk+-1.1.9 or earlier.

-- 
michael krause [aka raw style / lego] - www.tu-harburg.de/~semk2104/

#include <glib.h>
#include <gtk/gtk.h>

static void
file_selected (GtkWidget *w,
	       GtkFileSelection *fs)
{
    gtk_widget_hide(GTK_WIDGET(fs));
}

int main(int argc, char **argv)
{
    GtkWidget *thing, *box, *widget, *window, *win2;

    gtk_init (&argc, &argv);

    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

    box = gtk_vbox_new(FALSE, 0);
    gtk_container_add(GTK_CONTAINER(window), box);    
    gtk_widget_show(box);

    thing = gtk_button_new_with_label ("pop up");
    gtk_box_pack_start(GTK_BOX(box), thing, TRUE, TRUE, 0);
    gtk_widget_show(thing);

    win2 = gtk_file_selection_new("double-click some file, do NOT press the OK button");
    gtk_signal_connect(GTK_OBJECT (GTK_FILE_SELECTION (win2)->ok_button),
		       "clicked", GTK_SIGNAL_FUNC(file_selected),
		       win2);
    
    gtk_widget_show(window);
    gtk_widget_show(win2);

    gtk_main();

    return 0;
}


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