Re: [AD] OSX and set_close_button_callback

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 7/12/07, Dustin Dettmer <dustin@xxxxxxxxxx> wrote:
The docs for set_close_button_callback (and in the OSX section) claim that
it's called not only when the user presses the close button, but also when
the user selects Quit from the application menu (Command-Q). This is like a
good idea, but it doesn't work. My game quits nicely when I click the close
button, but Quit is greyed out in the menu, and Command-Q does nothing.

It used to work. The most recent revision to main.m broke it.

Attached is a patch that fixes it. Disclaimer: I know nothing about
Cocoa or OS X development, so it may or may not be correct.

I believe it's fair to say that the reason it was disabled is that the
target/selector did not exist. The default behavior is to disable
menus that have no objects that can respond to the message. When
manually enabling the menu by using menu.setAutoenablesItems =-NO and
menu_item.setEnabled: YES, the menu item was enabled, but gave this
error when clicking:

2007-07-12 18:08:34.527 exhello[4512] *** -[AllegroAppDelegate
terminate:]: selector not recognized [self = 0x606fe0]

--
Matthew Leverton

Attachment: main.m.diff
Description: Binary data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/