Winforms app under Mac OS X: change menu name

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

Winforms app under Mac OS X: change menu name

by Andrew Brehm :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This has probably been asked before but I couldn't find it.

Is it possible for a Winforms app to rename the top screen menu in Mac
OS X to something other than Mono?

The menu doesn't have to work, it should just show the correct app
name. It would be great if the "Quit" menu item could be made to work
for the app though.

Any ideas?
_______________________________________________
Mono-osx mailing list
Mono-osx@...
http://lists.ximian.com/mailman/listinfo/mono-osx

Re: Winforms app under Mac OS X: change menu name

by Lee V. Andrus :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The MonoDevelop for Mac Preview seems to have done the trick and more:
http://go-mono.com/forums/#nabble-to23418439%7Ca23418568
I am not sure how.  There is a mention that the Mac-friendly features involve a lot of PInvokes of Carbon functions.

When I tried to do something similar with Cocoa via MCocoa & MObjc there seemed to be no connection between the menu displayed and the mainMenu property of the NSApplication object.  It was nil initially.  When I tried to create a menu and set this property to it, there was no change in the displayed menu.

Andrew Brehm wrote:
Is it possible for a Winforms app to rename the top screen menu in Mac
OS X to something other than Mono?

The menu doesn't have to work, it should just show the correct app
name. It would be great if the "Quit" menu item could be made to work
for the app though.

Re: Winforms app under Mac OS X: change menu name

by Alexander Shulgin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Lee V. Andrus wrote:

> The MonoDevelop for Mac Preview seems to have done the trick and more:
> http://go-mono.com/forums/#nabble-to23418439%7Ca23418568
> http://go-mono.com/forums/#nabble-to23418439%7Ca23418568 
> I am not sure how.  There is a mention that the Mac-friendly features
> involve a lot of PInvokes of Carbon functions.
>
> When I tried to do something similar with Cocoa via MCocoa & MObjc there
> seemed to be no connection between the menu displayed and the mainMenu
> property of the NSApplication object.  It was nil initially.  When I tried
> to create a menu and set this property to it, there was no change in the
> displayed menu.

The application name in main menu is set automatically by the system,
when you launch a Mac OS X application, i.e. open a MyProgram.app
special folder in Finder.  I don't know if there's any other method to
set this name.

To handle Quit item correctly you'll need some magic with Carbon
P/Invokes, though.

--
Regards,
Alex

_______________________________________________
Mono-osx mailing list
Mono-osx@...
http://lists.ximian.com/mailman/listinfo/mono-osx