Re: [AD] native menus

[ Thread Index | Date Index | More Archives ]

On 13 Jul 2011, at 10:50 , Matthew Leverton wrote:
> Would you add core public functions that the addon would make use of
> like al_set_osx_app_menu(NSMenu *menu) along with perhaps something
> like al_add_osx_menu_callback( func_callback ), or just keep that
> private?

I haven't settled on that one way or the other.
I'm not a big fan of public platform-specific functions though, so I would try to hid them if at all possible. On the other hand, we already have similar functions for other platforms so there's no real harm in doing the same on OS X.

> It seems like the core would have to know a little something
> about the addon in order to query which menu to use on display change,
> although that too could be via some private callback hook.

That's actually why I was thinking of storing the information in Allegro's OSX_DISPLAY structs: the information can then be set automatically when the display is switched in. There may be some caveats I didn't think through fully.
By the way, we should preserve the default menu entries we create already (the Application and Window menu's) since they're supposedly standard...

> For Windows, I was able to keep all knowledge of the addon outside of
> core by adding a public function (al_add_win_window_callback) that
> intercepts all Windows messages. But that does have a larger use case
> outside just setting menus.

It's not inconceivable that the same thing could be useful on OS X, so maybe having a function like that on all platforms (it's platform specific, but the semantics is the same on every platform) would be a good thing.


Mail converted by MHonArc 2.6.19+