Re: [AD] OSX and set_close_button_callback

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


On 2007-07-15, Matthew Leverton <meffer@xxxxxxxxxx> wrote:
>  On 7/12/07, Matthew Leverton <meffer@xxxxxxxxxx> wrote:
> > Attached is an alternative patch that just lets Cocoa automatically
> > decide which object to send the terminate message.
> >
>  Peter Hull confirmed that this was a proper solution, but upon request
>  he created a better patch (attached) that only enables the Quit menu
>  if a callback is registered.

Can you commit this with some minor formatting changes?

> Index: src/macosx/main.m
> ===================================================================
> --- src/macosx/main.m	(revision 8071)
> +++ src/macosx/main.m	(working copy)
> @@ -142,9 +142,7 @@
>     [pool release];
>     _unix_destroy_mutex(osx_event_mutex);
>  }
> -
> -
> -
> + 
>  /* applicationDidChangeScreenParameters:
>   *  Invoked when the screen did change resolution/color depth.
>   */

Normally there are three blank lines between functions, although the OSX
port might not follow this.

> @@ -200,6 +198,29 @@
>     return NSTerminateCancel;
>  }
>  
> +/* quitAction:
> + * This is connected to the Quit menu. 
> + * The menu sends this message to the delegate, rather than 
> + * sending terminate: directly to NSApp, so that we get a 
> + * chance to validate the menu item first.
> + */

The actual comment text should be indented by a further space.

Thanks.

Peter




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