创建一个跨平台的Windows,Mac OS X应用 [英] Create a cross platform Windows, Mac OS X application

查看:1161
本文介绍了创建一个跨平台的Windows,Mac OS X应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立一个在Windows和Mac OS X上运行的应用程序我也
喜欢它利用最好的东西它运行在该平台所提供的问候框架,API的等。有没有办法做到这一点,而无需编写Objective-C代码,然后C#代码?我一直在想C ++作为替代,但我不知道是否还有别的那里。该应用程序将基于GUI的(虽然我不知道究竟会做还)

I would like to build an application that runs on both Windows and Mac OS X. I would also like it to leverage the best of what the platform it runs on has to offer with regards to Frameworks, API's etc. Is there a way to do this without having to write Objective-C code and then C# code? I've been thinking of C++ as an alternative but I was wondering if there was anything else out there. The app will be GUI based (though I don't know exactly what it will do yet)

-G。

推荐答案

这是很好的,你早就想便携性 - 它是困难得多,以博尔特它的事后

It's good that you're thinking of portability early on - it's vastly more difficult to "bolt it on" after the fact.

有各种提供跨平台的工具包,但恕我直言他们都落在有点短,提供本机外观和感觉所有支持的平台上。在Mac上(我用的),这种试剂盒的支持者总是想一提的是他们使用本地控件。这是一个良好的开端,但它不是整个旅程。由苹果的人机界面指南讨论的其他问题包括控制应如何安排,按钮标签应如何措辞,应该用什么标准快捷键等。

There are various cross-platform kits available, but IMHO all of them fall a bit short of providing a "native" look and feel on all the supported platforms. On the Mac (what I use), proponents of such kits always want to mention that they're using native controls. That's a good start, but it's not the whole journey. Other issues addressed by Apple's Human Interface Guidelines include how the controls should be arranged, how button labels should be phrased, what standard shortcut keys should be used, etc.

即使微软必须的learn硬盘的方式了解的尝试写一个跨平台的GUI的危险,与命运多舛的Word 6.0的Mac。

Even Microsoft had to learn the hard way about the dangers of trying to write a cross-platform GUI, with the ill-fated Word 6.0 for Mac.

恕我直言,更好的方法是使用 MVC 设计,写在标准的,可移植的C ++模型层,并使用每个平台的原生工具包的视图和控制器层。在整个过去,现在不再支持一个有趣的选项,所以你会想使用可可,使用Objective-C在你的控制器视图和Objective-C ++来弥补语言的差距Mac版本,碳和C ++。您的Windows版本同样可以编译你的模型为托管C ++,并使用控制器和视图任何.NET语言。

IMHO, a better approach is to use an MVC design, with the model layer written in standard, portable C++, and the view and controller layers using the native toolkit for each platform. For the Mac version, Carbon and C++ throughout used to be an interesting option that is now not supported anymore, so you would want to use Cocoa, using Objective-C in the view and Objective-C++ in your controllers to bridge the language gap. Your Windows version could likewise compile your model as "managed C++", and use any .NET language for controllers and views.

这篇关于创建一个跨平台的Windows,Mac OS X应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆