Re: transient windows on win32



Hi,

I think I'm having a similar problem with transient window.
Here is a testcase that shows the problem :
- we have two toplevel windows wtop and wdiag.
- wdiag is launching notepad.
- After closing notepad, the focus is given to wtop although it should be given
to wdiag.

Could someone compile test_transient.c with Charles Reilly's patch and see if it
works ?

Thanks,
Mehmet

-------test_transient.c -------------------------------------
#include <gtk/gtk.h>
#include <stdio.h>

static gboolean	on_click(GtkWidget *w)
{
char	*cmd = "'C:\\windows\\notepad.exe'";
g_spawn_command_line_sync(cmd, NULL, NULL, NULL, NULL);
return TRUE;
}

int	main(int argc, char *argv[])
{
GtkWidget *wtop, *wdiag, *w;

gtk_init(&argc, &argv);

wtop = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(wtop), "Fenetre princiaple");
gtk_signal_connect_after(GTK_OBJECT(wtop), "delete-event", (GtkSignalFunc)
gtk_exit, NULL);

wdiag = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(wdiag), "gtk dialog");
gtk_window_set_transient_for(GTK_WINDOW(wdiag), GTK_WINDOW(wtop));

w = gtk_button_new_with_label("launch notepad.exe");
gtk_signal_connect_after(GTK_OBJECT(w), "clicked", (GtkSignalFunc) on_click,
NULL);
gtk_container_add(GTK_CONTAINER(wdiag), w);

gtk_widget_show_all(wtop);
gtk_widget_show_all(wdiag);

gtk_main();
}



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