Re: transient windows on win32



Hi,

I tried your code under Windows with GTK+ 2.8.6
runtime, and it is as you said : wtop is been given
the focus.
I modifyied your code, adding :
gtk_window_set_modal (GTK_WINDOW (wdiag), TRUE); 
and then wtop cannot receive events (that's normal),
and then wdiag is the sole to receive events (it has
focus).

I'm wondering if the trouble couldn't be that you are
using two top level windows whereas you should use one
top_level window and a dialog window ?

Regards,

Benoît Carpentier, "GTKool"

--- myasar free fr a écrit :

> 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();
> }
> _______________________________________________
> gtk-devel-list mailing list
> gtk-devel-list gnome org
>
http://mail.gnome.org/mailman/listinfo/gtk-devel-list
> 



	
	
		
___________________________________________________________________________ 
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger 
Téléchargez cette version sur http://fr.messenger.yahoo.com



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