[Mono-osx] Menu Bar for Mac OS X?

Elfen pem.accounts.spam at gmail.com
Sun Apr 4 18:36:10 EDT 2010


This section talks specifically about Java Swing:

http://developer.apple.com/mac/library/documentation/Java/Conceptual/Java14Development/04-JavaUIToolkits/JavaUIToolkits.html

Referencing JMenuBar, JTabbedPane, JComboBox, and other GUI controls.

Expecting every single application developer to rewrite the entire GUI would
be a huge waste of effort.  If we have 10,000 people write applications that
use Mono GTK#, they should not all write two copies of their GUI's.  The GUI
framework (such as Java Swing, or Mono GTK#, or Qt, etc) should do the 99%
of it that is possible (such as the look and feel for Aqua)...  Then the
application developers who use the GUI API would only have to do the last 1%
that is application-specific (such as  application-specific menu bar /
application bar, application-specific app bundle config).  Unless I am
completely confused, I think Apple's "Java Development Guide for Mac OS X"
clearly agrees?

Java Swing does the Aqua interface look and feel for you.  This is the
responsibility of Mono GTK#, so that every single application developer that
wants to use Mono GTK# does not have to reinvent the wheel.  Right?

thank you for the discussion on this

On Sun, Apr 4, 2010 at 4:41 PM, Elfen <pem.accounts.spam at gmail.com> wrote:

> HIG from Apple for Java found here (Mac OS X Integration for Java) (it
> seems like these goals should be similar for Mono too):
>
>
> http://developer.apple.com/mac/library/documentation/Java/Conceptual/Java14Development/00-Intro/JavaDevelopment.html#//apple_ref/doc/uid/TP40001911
>
> For example, it says:
> By default, Swing applications in Mac OS X use the Aqua look and feel
> (LAF).
>
> For example, it says:
> Listing 5  Setting JScrollBar  policies to be more like those of Aqua
> JScrollPane jsp = new JScrollPane();
> jsp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
> jsp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
>
> So it doesn't say "rewrite your entire GUI just for Mac OS X", and it does
> say "use the JScrollBar" (Mono's equivalent of GTK# would be Java Swing -
> right?).
>
> I didn't see anything about Interface Builder, or rewriting your entire
> GUI, in Apple's (Mac OS X Integration for Java) doc?
>
> I realize that I may be confused...  But isn't your suggestion both
> (impractical / an unreasonable amount of extra work) and (a violation of
> Apple's "Mac OS X Integration for Java" guidelines)?
>
> I hope my comments do not sound adversarial...  I am just having trouble
> understanding how (rewrite the entire GUI using Interface Builder) is
> consistent with Apple's "Mac OS X Integration for Java" doc?
>
> thank you
>
>
> On Sun, Apr 4, 2010 at 4:52 AM, Joanna Carter <
> cocoasharp at carterconsulting.org.uk> wrote:
>
>> Hi Elfen
>>
>> > 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 :-)
>>
>> Joanna
>>
>> --
>> Joanna Carter
>> Carter Consulting
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20100404/e7708396/attachment.html 


More information about the Mono-osx mailing list