[gtkada] Quitting program on the [X] button

Dmitry A. Kazakov mailbox at dmitry-kazakov.de
Mon Jun 22 09:26:03 CEST 2009


On Mon, 22 Jun 2009 09:37:41 +0800, you wrote:

> Of the three buttons at top right of a top-level window, only the [X] button
> requires an event handler to operate.

Actually these buttons have nothing to do with Gtk. Decorations of
top-level windows is property of the window manager, like twm, mwm etc.

> I think this is because the [X] button is the only button of the three which
> requires control of the 'Main' loop.
> Is that right?

No. All actions of the window manager (minimize, maximize, move, paint etc)
are handled (reacted) ultimately in the main loop. That Gtk explicitly
exits the main loop, is an artefact of its design. Theoretically it is
possible to quit the loop getting the corresponding signal from the window
manager, like WM_QUIT under Windows, by default. The designers of Gtk
probably didn't care.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



More information about the gtkada mailing list