Re: [gtk-list] modals windows




On Mon, 8 Nov 1999, Adrian Feiguin wrote:
> If I understand, a modal window is nothing else but a window with its own
> main loop, and the focus grabbed on it. Please tell me if I'm wrong, but I
> think there is a bug in testgtk. If you open the modal window test, and
> you destroy the main testgtk window, the main loop is still running and 
> the modal window is still there. Is this the
> spected behavior? How would you destroy the modal in this case?

Many, many applications are broken in this way; the modal window normally
disables input to all the other windows, but the window manager "close"
button remains, and people don't remember that. The solution is to 
either disable the "close" button, or connect a delete_event handler which
keeps it from taking effect.

It might make sense to automatically set the close-button-disable hint if
a toplevel is insensitive, dunno. A thought anyway. Of course, in this
case the toplevel isn't automatically insensitive, it just doesn't have
the grab, though I tend to set the non-grabbed windows insensitive.

As a nit-pick, a modal window doesn't have to have its own recursive call
to gtk_main(), it's just a programming convenience so a function can block
until it gets user input. The thing that makes the window modal is that
it has the input grab.

Havoc




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