Quitting program on the [X] button

View: New views
2 Messages — Rating Filter:   Alert me  

Quitting program on the [X] button

by Rick Duley-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am trying to gain an understanding of the thinking behind GtkAda so this might seem a simple question but I'd still appreciate  knowing the answer.
 
Of the three buttons at top right of a top-level window, only the [X] button requires an event handler to operate.
 
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?
--
Rick Duley
North Perth,
Western Australia                  
http://www.freewebs.com/rickduley/
                                    .-_|\
                                   /     \
                             perth *_.-._/
                                        v
aussie :    
  04... 
o'seas :   +61 ... 
--------------------------------------------
Committees:
"... dark alley down which ideas are led
                   ... then strangled."
                                  (PepsiCo)

_______________________________________________
gtkada mailing list
gtkada@...
http://lists.adacore.com/mailman/listinfo/gtkada

Re: Quitting program on the [X] button

by Dmitry A. Kazakov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
_______________________________________________
gtkada mailing list
gtkada@...
http://lists.adacore.com/mailman/listinfo/gtkada