RE: Problem on hiding toplevel window



    gtk_widget_show(window);
    while(gtk_events_pending()) gtk_main_iteration();
    gtk_widget_hide(window);


will get around.



-----Original Message-----
From: gtk-app-devel-list-admin gnome org
[mailto:gtk-app-devel-list-admin gnome org] On Behalf Of Choe Hwanjin
Sent: Saturday, November 22, 2003 10:06 PM
To: gtk-app-devel-list gnome org
Subject: Problem on hiding toplevel window

Hi.

I made a gtk app which hide main window on loading. But it does not
work correctly. So I made test code:

int 
main(int argc, char *argv[])
{
    GtkWidget *window;
    GtkWidget *label;

    gtk_init(&argc, &argv);

    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    g_signal_connect(G_OBJECT(window), "destroy",
G_CALLBACK(on_destroy), NULL);

    label = gtk_label_new("This window must be hided");
    gtk_container_add(GTK_CONTAINER(window), label);
    gtk_widget_show(label);

    gtk_widget_show(window);
    gtk_widget_hide(window);

    gtk_main();

    return 0;
}

When I run this small test code, toplevel window does not disappear.
I'm using xfce4. So I test it with other window managers. On metacity,
disappeared, on twm, does not disappeared.

How do I hide main window correctly?
My code is wrong or this is a gtk+'s bug?

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




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