On Mac, close button quits the program

On May 17, 2007, at 1:29 PM, SourceForge.net wrote:

Submitted By: Donald Ephraim Curtis (dcurtis3)
Assigned to: Nobody/Anonymous (nobody)
Summary: On Mac, close button quits the program

Initial Comment:
On the Mac OSX port the close buttons quits the program rather than
clearing the current molecule.

This isn’t quite correct Mac behavior, but it is acting as intended.
Native Mac programs allow you to close a window, and the application
stays open to allow you to use the “New” and “Open” menu items. This
is impossible with Qt because there’s no MainWindow object to take
these calls.

So on Mac, I’ve set it to quit after all windows are closed.

On the other hand, when you have multiple windows, closing a window
acts like Mac users expect – it closes that window, and others are
still available.

Mac users would be extremely upset if “close” didn’t actually make
the window go away.

So on Mac with current Qt versions, you have two unhappy alternatives:

  • The application only has one main window (i.e., you can’t open more
    than one molecule).
  • The application has multiple main windows but quits after closing
    all of them.

Suggestions, work-arounds, or other comments would be most welcome. I
felt the current behavior was the least bad alternative of the two.

Cheers,
-Geoff

On May 17, 2007, at 2:55 PM, Donald Ephraim Curtis wrote:

We could maybe put in a kinda “Mac Only” think where when there is
only
one MainWindow left and you hit close, it just hides the window, then
when you do open / new it just shows that MainWindow.

Yes, I thought of this when writing my last message. It’s a good
idea. asically, you’d check qApp()->topLevelWidgets().size() == 1.

The trick is that you’d also want to disable almost every menu item,
then bring them back. Something to put on the todo list.

Cheers,
-Geoff

We could maybe put in a kinda “Mac Only” think where when there is only
one MainWindow left and you hit close, it just hides the window, then
when you do open / new it just shows that MainWindow. Just trick it
into acting that way. It would have to know it’s the only window open
but i think qApp can easily tell us we’re the last window.


Donald

(Thu, May 17, 2007 at 01:47:31PM -0400) Geoffrey Hutchison geoff.hutchison@gmail.com:

On May 17, 2007, at 1:29 PM, SourceForge.net wrote:

Submitted By: Donald Ephraim Curtis (dcurtis3)
Assigned to: Nobody/Anonymous (nobody)
Summary: On Mac, close button quits the program

Initial Comment:
On the Mac OSX port the close buttons quits the program rather than
clearing the current molecule.

This isn’t quite correct Mac behavior, but it is acting as intended.
Native Mac programs allow you to close a window, and the application
stays open to allow you to use the “New” and “Open” menu items. This
is impossible with Qt because there’s no MainWindow object to take
these calls.

So on Mac, I’ve set it to quit after all windows are closed.

On the other hand, when you have multiple windows, closing a window
acts like Mac users expect – it closes that window, and others are
still available.

Mac users would be extremely upset if “close” didn’t actually make
the window go away.

So on Mac with current Qt versions, you have two unhappy alternatives:

  • The application only has one main window (i.e., you can’t open more
    than one molecule).
  • The application has multiple main windows but quits after closing
    all of them.

Suggestions, work-arounds, or other comments would be most welcome. I
felt the current behavior was the least bad alternative of the two.

Cheers,
-Geoff


This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/


Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
avogadro-devel List Signup and Options