Re: Windows over Windows



dhk wrote:
Gregory Hosler wrote:
dhk wrote:
| How can a modal window or dialog from a secondary event always and
| completely cover the main window?  The main window should look like it
| was replaced until the second window or dialog is closed.

Depending upon the sizes of the two windows... The modal window can parent itself, and center itself over the child window. Of course the user can still drag the modal window, uncovering the child window. An alternative would be to have the modal window "hide" the parent window (if that's what you really want), and then unhide it when it is being destroyed.

-G

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


I like the hide idea, but when I try to hide the main window nothing happens. The basic logic I'm using to try to hide the main window when a new window pops up after selecting from the menu in the main window is:
GtkWidget *tlwin=gtk_widget_get_toplevel(GTK_WIDGET(menuitem));
gtk_widget_hide(tlwin);

Any ideas why the main window is still there?
In my view, you should have a window structure of your own, which among other things points to the Gtk window. Then you just have to get the top window origin and dimensions and create the task dialog with the same geometry, save the pointers you need in your window structure, etc...

Incidentally, if you want to have multiple top windows then this window structure is the data pointer that you should pass in g_signal_connect functions, because this way you are automatically on the active top window everytime the user does something!

Carlos



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