[Mono-osx] Menu Bar for Mac OS X?
cocoasharp at carterconsulting.org.uk
Sun Apr 4 05:52:24 EDT 2010
> So you're saying I should have something like: if platform is windows or linux then use winforms, else if platform is mac os x then use interface builder? I think the correct thing to do for cross-platform development is only use platform conditional on the minimum amount of code. Yes I am asking about System.Windows.Forms. For example, it sounds like you are saying:
> if (platform is windows or linux )
> this.menuItem_File = new System.Windows.Forms.ToolStripMenuItem();
> this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
> else if (platform is mac os x)
> do some crazy interface builder stuff
> Btw, I was hoping for some kind of simple tutorial / doc... Since I would expect this to be an extremely common thing. Any application that follows Mac OS X interface guidelines will use the menu bar, rather than the Windows/Linux per-window menu style.
See my other reply. Cross-platform apps are not something that can be created without a lot of effort, especially if you ever expect MAc users to accept them. Neither Winforms nor GTK UIs are acceptable in the OS X Aqua world.
Fortunately, Apple have used the MVC design pattern to separate UI design from the business model, thus allowing you to use Mono to create the "backend" code, whilst using the Monobjc bridge to talk to UIs created in Interface Builder. Of course, you will also have to adhere to the same separation of concerns when creating the Winforms and GTK versions.
> I think you are from the context. Joanna has skipped a step in replying if so. Winforms is not the "way to go" and you would have a more Mac alike experience using one of the Cocoa wrappers and Interface Builder. Yes, you will not get straight reuse, but you will otherwise be fitting a square peg into a round hole.
Matt, see my reply, written whilst you were composing your reply :-)
More information about the Mono-osx