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)
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? 我一直在考虑使用c++作为替代方法,但我想知道是否还有其他东西。这个应用程序将基于GUI(尽管我还不知道它将做什么)
-G.
- g。
21 个解决方案
#1
48
It's good that you're thinking of portability early on - it's vastly more difficult to "bolt it on" after the fact.
在早期考虑可移植性是件好事——事后想要“把它挂住”要困难得多。
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.
有各种各样的跨平台工具包可用,但IMHO的所有组件都有一些不足,它们在所有受支持的平台上提供“原生”外观和感觉。在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.
就连微软也不得不艰难地认识到,尝试编写跨平台GUI的危险,因为Mac使用的是倒霉的Word 6.0。
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.
更好的方法是使用MVC设计,模型层用标准的、可移植的c++编写,视图层和控制器层使用每个平台的本机工具包。对于Mac版本来说,Carbon和c++一直以来都是一个有趣的选项,现在已经不再支持它了,所以您可能想要使用Cocoa,在视图中使用Objective-C,在控制器中使用Objective-C+来弥合语言的鸿沟。您的Windows版本同样可以将您的模型编译成“托管c++”,并使用任何。net语言来进行控制器和视图。
#2
16
Take a look at Real Studio. Seriously. You can write an app in Real Studio and deploy it on Windows, Mac OS X, and Linux.
看看真正的工作室。认真对待。您可以在Real Studio中编写一个应用程序,并将其部署到Windows、Mac OS X和Linux上。
Edit: Real Studio is now Xojo.
编辑:Real Studio现在是Xojo。
#3
6
wxWidgets is a cross platform C++ library, which is a practical choice. But I agree with Sherm - all cross platform libraries do create an inferior UI to native applications.
wxWidgets是一个跨平台c++库,是一个实际的选择。但我同意Sherm的观点——所有跨平台库都创建一个不如本地应用程序的UI。
It's made harder by each OS having different UI semantics (button orders etc), so while you may achieve a good look, getting the 'feel' right on each platform via one view layer is almost bound to be impossible.
由于每个操作系统都有不同的UI语义(按钮命令等),这就变得更加困难了,所以尽管您可能会获得一个好的外观,但是通过一个视图层在每个平台上获得“感觉”几乎是不可能的。
Depending on what you end up doing, you may find a web interface better (e.g. embed a web server in your app and serve HTTP pages to a browser). You avoid the L&F issues then!
根据您最终的工作,您可能会发现更好的web界面(例如,在应用程序中嵌入web服务器并向浏览器提供HTTP页面)。那么你就可以避免L&F问题了!
Alternatively, you can decide you're just going to have a completely non-standard L&F, and go for something like wxWidgets, or Tcl/Tk.
或者,您可以决定只使用完全非标准的L&F,然后使用wxWidgets或Tcl/Tk。
#4
4
Adobe Flex, with the AIR libraries, does a good job of giving you a single, highlevel development environment for this sort of thing. I've written several utilities that people use on both platforms interchangeably.
借助AIR库,Adobe Flex为您提供了一个单独的高级开发环境。我已经编写了几个实用程序,人们可以在这两个平台上互换使用。
You also get reasonable portability to a browser thrown in, too, if that's of interest. But I think it's a pretty good solution without considering that benefit.
如果你感兴趣的话,你还可以获得合理的浏览器可移植性。但我认为这是一个很好的解决方案而不考虑它的好处。
#5
4
My suggestion, use Python. Python integrates with both Objective-C and C# (IronPython). Just avoid a lot of the brand new bleeding edge features of the language and you're ok.
我的建议,使用Python。Python集成了Objective-C和c# (IronPython)。只要避免很多全新的边缘特性,你就没事了。
Granted, it won't be mindlessly easy. But I'd argue that it shouldn't be mindlessly easy. It becomes very apparent when designers don't take into consideration how their application will work when it gets ported to another platform.
当然,这并不容易。但我认为这不应该是盲目的容易。当设计人员不考虑应用程序在移植到另一个平台时将如何工作时,这一点就变得非常明显。
#6
3
For the GUI, I'd look into SDL or QT.
对于GUI,我将研究SDL或QT。
Also, check out mono http://mono-project.com/Main_Page
另外,请查看mono http://mono-project.com/Main_Page
#7
3
If you do decide to go with C++ there are a number of good cross-platform GUI libraries that will allow you to avoid having to duplicate the GUI code for each platform. For example:
如果您决定使用c++,那么有许多优秀的跨平台GUI库,可以避免为每个平台重复GUI代码。例如:
There are a number of other similar projects but those are some of the better and more well-known ones. For the remainder of your code, anything system-specific will of course have to be written using separate C++ code to interface with Win32 APIs or OS X's system API where necessary. That being said, you may find you're able to avoid much of the system-specific code by using extensive libraries like Boost.
还有许多类似的项目,但这些都是一些更好的、更知名的项目。在剩下的代码中,任何特定于系统的代码当然都必须使用单独的c++代码编写,以便在必要时与Win32 API或OS X的系统API进行交互。话虽如此,您可能会发现,通过使用Boost之类的大型库,您可以避免许多系统特定的代码。
Other suggestions would be things like using a configuration file instead of the Windows registry or a plist file on the mac. Instead, shoot for platform-agnostic approaches wherever possible to minimize the places where you have to write code using system APIs.
其他建议可能是使用配置文件而不是Windows注册表或mac上的plist文件。
#8
3
You should use the best tools available for each OS.
您应该使用每个操作系统可用的最佳工具。
C/C++ code can be separated from the GUI and used in each separately developed program.
C/ c++代码可以从GUI中分离出来,并在每个单独开发的程序中使用。
Before you make a decision, take a look at cross-platform apps that have been developed with portable toolkits such as Qt or wxWidgets. In my experience they are never as polished as their native counterparts, especially on the mac.
在做出决定之前,先看看使用Qt或wxWidgets等便携式工具包开发的跨平台应用程序。在我的经验中,他们从来没有像他们的本地对手那样出色,尤其是在mac上。
#10
2
If you're a Windows developer, use either Qt or C# Winforms; if you're a Mac developer, you could try Cocotron (http://www.cocotron.org/), but it's not 100% finished yet, though commercial apps have been shipped with it.
如果您是Windows开发人员,请使用Qt或c# Winforms;如果你是Mac的开发人员,你可以试试Cocotron (http://www.cocotron.org/),但是它还没有100%的完成,尽管商业应用已经随它发布。
#11
2
thanks for all your answers. I've been doing some research and playing around with WPF and CAnimation etc. It looks like using a C/C++ model and doing the GUI individually for each platform is the best way to go. Thanks for all your help.
谢谢你的回答。我一直在做一些研究,研究WPF和CAnimation等。看起来使用一个C/ c++模型,为每个平台分别做GUI是最好的方法。谢谢你的帮助。
#12
1
Also check out fltk , wxWidgets is very good & rich but also very big...
还可以看看fltk, wxWidgets非常好和丰富,但也非常大……
#13
1
As others have mentioned is is definitely possible to create good looking cross platform GUI in Java on both Windows and Mac. However if you want your app to blend in and behave in a way that makes it "feel" like an application designed from the ground up for the platform it is running on, you really have to develop the GUI and user experience for each version of the application separately.
当别人提到过是肯定可以创建漂亮的跨平台的GUI在Java Windows和Mac。然而,如果你想让你的应用程序融入和行为的方式使它“感觉”像一个应用程序而设计的平台上运行,你必须开发GUI,分别为每个版本的应用程序的用户体验。
If you analyze what your application is going to do and figure that there is a significant portion of code/logic that could be shared between platforms then write that portion in a portable way in a language that is available on both systems. C, C++, Java, Python, Ruby, etc. If there isn't a significant portion, ie most of the code is going to be for the GUI then there is less of a case for sharing any code at all.
如果您分析您的应用程序将要做什么,并指出平台之间可以共享代码/逻辑的很大一部分,然后以可移植的方式编写这部分代码/逻辑,这种语言在两个系统上都是可用的。C、c++、Java、Python、Ruby等。如果没有重要的部分,即大部分代码都是为GUI编写的,那么共享任何代码的情况就更少了。
In the case that there is a significant portion of common code, I would suggest looking into Python and Ruby as implementation languages as there are Cocoa bindings for those languages on the Mac and on Windows with the use of IronPython and IronRuby you could use reuse that code in a .Net application as well.
如果有很大一部分通用代码,我建议调查Python和Ruby实现语言如有可可绑定这些语言在Mac和Windows使用IronPython和IronRuby您可以使用. net应用程序中重用代码。
#14
0
As long as you are not tied to languages, it looks like Java is a good candidate. Pair that up with SWT for the GUI, and you will have a native looking app on any OS you like.
只要您不受语言的限制,看起来Java是一个很好的候选者。将它与GUI的SWT组合在一起,您将在任何您喜欢的操作系统上都有一个本机外观的应用程序。
#15
0
I'm planning to do a similar thing, and I'm considering creating a C#/.NET Windows application and then porting it to OS X using Mono. My application already has a completely (except for the title bar and corner buttons) custom-drawn user interface, so the cosmetic OS differences shouldn't affect me too much.
我正计划做类似的事情,我正在考虑创建一个c# /。NET Windows应用程序,然后使用Mono将其移植到OS X。我的应用程序已经有了一个完全定制的用户界面(除了标题栏和角落按钮),所以外观操作系统的差异不会对我有太大的影响。
I'm not sure what you mean by leveraging the best of each platform in terms of frameworks and APIs and so forth. In general, writing a cross-platform application means writing to a least common denominator, and thus means not getting the best out of each platform.
我不确定您在框架和api等方面利用每个平台的优点是什么意思。一般来说,编写跨平台应用程序意味着编写一个最小公分母,因此意味着不能充分利用每个平台。
#16
0
Java or Mono come to my mind. Some people may argue that java graphical toolkits are not the cuttest out there but it seems to be, at least to me, the easiest way to port your application to several platforms and avoid deployment difficulties.
我想到了Java或Mono。有些人可能会说,java图形工具包并不是最简单的,但至少对我来说,它是将应用程序移植到多个平台并避免部署困难的最简单的方法。
Mono, on the other hand, could be a little bit more difficult to port as you would have to write at least the gui twice if you plan to have native widgets (either winforms or GTK for windows and CocoaSharp for Max) but you could write the backend only once and develop a frontend for each platform.
Mono,另一方面,可能更难以港口至少您必须编写gui两次如果你计划有本地小部件(winforms或GTK为windows和CocoaSharp Max)但是你可以只写一次后端和前端开发为每个平台。
As I said, Java GUI toolkits might not feel "native" inside OSX or even on Windows but they sure work on both platforms, you could use either Swing or AWT.
正如我所说的,Java GUI工具包可能不会在OSX内部甚至Windows中感到“原生”,但它们肯定在两个平台上都能工作,您可以使用Swing或AWT。
As for mono, you can use GTK or Winforms for both windows and OSX but they still will not feel native, you can, however use CocoaSharp which are bindings to the Cocoa framework but Im not sure about the status of the project (read: functionality support)
至于mono,您可以对windows和OSX都使用GTK或Winforms,但它们仍然不会让人觉得是原生的,但是可以使用与Cocoa框架绑定的CocoaSharp,但我不确定项目的状态(阅读:功能支持)
#17
0
I second Java. It is designed as a cross-platform solution.
我第二个Java。它被设计成一个跨平台的解决方案。
Others have mentioned Adobe Air.
其他人提到了Adobe Air。
Similar to Adobe Air is Silverlight. I believe it is (or will be) completely cross platform.
与adobeair相似的是Silverlight。我相信它是(或将是)完全跨平台的。
#18
0
You can create fantastic looking cross platform applications with Java Swing. It just requires slightly more effort to learn to do so.
您可以使用Java Swing创建漂亮的跨平台应用程序。这只需要稍微多花点功夫就能学会。
Here, take a look at some of these links.
这里,我们来看看这些链接。
- http://jidesoft.com/products/component.htm
- http://jidesoft.com/products/component.htm
- http://www.xerto.com/imagery.php
- http://www.xerto.com/imagery.php
- http://www.jgraph.com/screenshots.html
- http://www.jgraph.com/screenshots.html
- http://www.javootoo.com/
- http://www.javootoo.com/
- http://www.formdev.com/screenshots/
- http://www.formdev.com/screenshots/
- http://www.jidesoft.com/products/oss.htm
- http://www.jidesoft.com/products/oss.htm
#19
0
The guys at Magnetism Studios have a nice write up on using Cocotron to build a Windows executable with Xcode.
磁性工作室的工作人员写了一篇关于使用Cocotron构建Windows可执行文件的文章。
I have no experience with Cocotron, but if I needed to write a windows app —with a Mac development background— this would be the first thing I'd try.
我没有使用过Cocotron的经验,但如果我需要编写一个windows应用程序——有Mac开发背景——这将是我尝试的第一件事。
#20
0
If you choose C++ language, I would definitely recommend Qt for that. Your application can be deployed under Windows and Mac as requested in the OP, but also Linux, and now, with the latest version on smartphones using iOs, Windows RT and Android.
如果你选择c++语言,我肯定会推荐Qt。您的应用程序可以按照OP的要求部署到Windows和Mac下,也可以部署到Linux下,现在还可以部署到使用iOs、Windows RT和Android的智能手机上。
It's well documented and very active on the web (including on SO).
它在web上有很好的文档记录和非常活跃的功能(包括它)。
The only negative point I see is Qt creator tool which, IMHO, is less user friendly than historical tools (like Visual Studio for instance ), but you are not actually forced to use it as an IDE for Qt development.
我看到的唯一的缺点是Qt creator工具,IMHO比历史工具(例如Visual Studio)更不友好,但实际上您并不需要将它用作Qt开发的IDE。
#21
0
For completeness, it's now worth adding Unity to the list.
为了完整性,现在值得在列表中添加Unity。
It would be very hard to create a native-looking app for either platform and the general GUI tools are far from mature. But, it's not just a game engine and you can write in C#/Mono, make use of a decent range of libs and deploy to Win and OSX fairly painlessly.
要为任何一个平台创建一个外观像本地的应用程序都是非常困难的,而且一般的GUI工具还远没有成熟。但是,它并不仅仅是一个游戏引擎,您可以使用c# /Mono编写,使用一系列不错的libs,并部署到Win和OSX上,相当轻松。
#1
48
It's good that you're thinking of portability early on - it's vastly more difficult to "bolt it on" after the fact.
在早期考虑可移植性是件好事——事后想要“把它挂住”要困难得多。
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.
有各种各样的跨平台工具包可用,但IMHO的所有组件都有一些不足,它们在所有受支持的平台上提供“原生”外观和感觉。在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.
就连微软也不得不艰难地认识到,尝试编写跨平台GUI的危险,因为Mac使用的是倒霉的Word 6.0。
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.
更好的方法是使用MVC设计,模型层用标准的、可移植的c++编写,视图层和控制器层使用每个平台的本机工具包。对于Mac版本来说,Carbon和c++一直以来都是一个有趣的选项,现在已经不再支持它了,所以您可能想要使用Cocoa,在视图中使用Objective-C,在控制器中使用Objective-C+来弥合语言的鸿沟。您的Windows版本同样可以将您的模型编译成“托管c++”,并使用任何。net语言来进行控制器和视图。
#2
16
Take a look at Real Studio. Seriously. You can write an app in Real Studio and deploy it on Windows, Mac OS X, and Linux.
看看真正的工作室。认真对待。您可以在Real Studio中编写一个应用程序,并将其部署到Windows、Mac OS X和Linux上。
Edit: Real Studio is now Xojo.
编辑:Real Studio现在是Xojo。
#3
6
wxWidgets is a cross platform C++ library, which is a practical choice. But I agree with Sherm - all cross platform libraries do create an inferior UI to native applications.
wxWidgets是一个跨平台c++库,是一个实际的选择。但我同意Sherm的观点——所有跨平台库都创建一个不如本地应用程序的UI。
It's made harder by each OS having different UI semantics (button orders etc), so while you may achieve a good look, getting the 'feel' right on each platform via one view layer is almost bound to be impossible.
由于每个操作系统都有不同的UI语义(按钮命令等),这就变得更加困难了,所以尽管您可能会获得一个好的外观,但是通过一个视图层在每个平台上获得“感觉”几乎是不可能的。
Depending on what you end up doing, you may find a web interface better (e.g. embed a web server in your app and serve HTTP pages to a browser). You avoid the L&F issues then!
根据您最终的工作,您可能会发现更好的web界面(例如,在应用程序中嵌入web服务器并向浏览器提供HTTP页面)。那么你就可以避免L&F问题了!
Alternatively, you can decide you're just going to have a completely non-standard L&F, and go for something like wxWidgets, or Tcl/Tk.
或者,您可以决定只使用完全非标准的L&F,然后使用wxWidgets或Tcl/Tk。
#4
4
Adobe Flex, with the AIR libraries, does a good job of giving you a single, highlevel development environment for this sort of thing. I've written several utilities that people use on both platforms interchangeably.
借助AIR库,Adobe Flex为您提供了一个单独的高级开发环境。我已经编写了几个实用程序,人们可以在这两个平台上互换使用。
You also get reasonable portability to a browser thrown in, too, if that's of interest. But I think it's a pretty good solution without considering that benefit.
如果你感兴趣的话,你还可以获得合理的浏览器可移植性。但我认为这是一个很好的解决方案而不考虑它的好处。
#5
4
My suggestion, use Python. Python integrates with both Objective-C and C# (IronPython). Just avoid a lot of the brand new bleeding edge features of the language and you're ok.
我的建议,使用Python。Python集成了Objective-C和c# (IronPython)。只要避免很多全新的边缘特性,你就没事了。
Granted, it won't be mindlessly easy. But I'd argue that it shouldn't be mindlessly easy. It becomes very apparent when designers don't take into consideration how their application will work when it gets ported to another platform.
当然,这并不容易。但我认为这不应该是盲目的容易。当设计人员不考虑应用程序在移植到另一个平台时将如何工作时,这一点就变得非常明显。
#6
3
For the GUI, I'd look into SDL or QT.
对于GUI,我将研究SDL或QT。
Also, check out mono http://mono-project.com/Main_Page
另外,请查看mono http://mono-project.com/Main_Page
#7
3
If you do decide to go with C++ there are a number of good cross-platform GUI libraries that will allow you to avoid having to duplicate the GUI code for each platform. For example:
如果您决定使用c++,那么有许多优秀的跨平台GUI库,可以避免为每个平台重复GUI代码。例如:
There are a number of other similar projects but those are some of the better and more well-known ones. For the remainder of your code, anything system-specific will of course have to be written using separate C++ code to interface with Win32 APIs or OS X's system API where necessary. That being said, you may find you're able to avoid much of the system-specific code by using extensive libraries like Boost.
还有许多类似的项目,但这些都是一些更好的、更知名的项目。在剩下的代码中,任何特定于系统的代码当然都必须使用单独的c++代码编写,以便在必要时与Win32 API或OS X的系统API进行交互。话虽如此,您可能会发现,通过使用Boost之类的大型库,您可以避免许多系统特定的代码。
Other suggestions would be things like using a configuration file instead of the Windows registry or a plist file on the mac. Instead, shoot for platform-agnostic approaches wherever possible to minimize the places where you have to write code using system APIs.
其他建议可能是使用配置文件而不是Windows注册表或mac上的plist文件。
#8
3
You should use the best tools available for each OS.
您应该使用每个操作系统可用的最佳工具。
C/C++ code can be separated from the GUI and used in each separately developed program.
C/ c++代码可以从GUI中分离出来,并在每个单独开发的程序中使用。
Before you make a decision, take a look at cross-platform apps that have been developed with portable toolkits such as Qt or wxWidgets. In my experience they are never as polished as their native counterparts, especially on the mac.
在做出决定之前,先看看使用Qt或wxWidgets等便携式工具包开发的跨平台应用程序。在我的经验中,他们从来没有像他们的本地对手那样出色,尤其是在mac上。
#9
#10
2
If you're a Windows developer, use either Qt or C# Winforms; if you're a Mac developer, you could try Cocotron (http://www.cocotron.org/), but it's not 100% finished yet, though commercial apps have been shipped with it.
如果您是Windows开发人员,请使用Qt或c# Winforms;如果你是Mac的开发人员,你可以试试Cocotron (http://www.cocotron.org/),但是它还没有100%的完成,尽管商业应用已经随它发布。
#11
2
thanks for all your answers. I've been doing some research and playing around with WPF and CAnimation etc. It looks like using a C/C++ model and doing the GUI individually for each platform is the best way to go. Thanks for all your help.
谢谢你的回答。我一直在做一些研究,研究WPF和CAnimation等。看起来使用一个C/ c++模型,为每个平台分别做GUI是最好的方法。谢谢你的帮助。
#12
1
Also check out fltk , wxWidgets is very good & rich but also very big...
还可以看看fltk, wxWidgets非常好和丰富,但也非常大……
#13
1
As others have mentioned is is definitely possible to create good looking cross platform GUI in Java on both Windows and Mac. However if you want your app to blend in and behave in a way that makes it "feel" like an application designed from the ground up for the platform it is running on, you really have to develop the GUI and user experience for each version of the application separately.
当别人提到过是肯定可以创建漂亮的跨平台的GUI在Java Windows和Mac。然而,如果你想让你的应用程序融入和行为的方式使它“感觉”像一个应用程序而设计的平台上运行,你必须开发GUI,分别为每个版本的应用程序的用户体验。
If you analyze what your application is going to do and figure that there is a significant portion of code/logic that could be shared between platforms then write that portion in a portable way in a language that is available on both systems. C, C++, Java, Python, Ruby, etc. If there isn't a significant portion, ie most of the code is going to be for the GUI then there is less of a case for sharing any code at all.
如果您分析您的应用程序将要做什么,并指出平台之间可以共享代码/逻辑的很大一部分,然后以可移植的方式编写这部分代码/逻辑,这种语言在两个系统上都是可用的。C、c++、Java、Python、Ruby等。如果没有重要的部分,即大部分代码都是为GUI编写的,那么共享任何代码的情况就更少了。
In the case that there is a significant portion of common code, I would suggest looking into Python and Ruby as implementation languages as there are Cocoa bindings for those languages on the Mac and on Windows with the use of IronPython and IronRuby you could use reuse that code in a .Net application as well.
如果有很大一部分通用代码,我建议调查Python和Ruby实现语言如有可可绑定这些语言在Mac和Windows使用IronPython和IronRuby您可以使用. net应用程序中重用代码。
#14
0
As long as you are not tied to languages, it looks like Java is a good candidate. Pair that up with SWT for the GUI, and you will have a native looking app on any OS you like.
只要您不受语言的限制,看起来Java是一个很好的候选者。将它与GUI的SWT组合在一起,您将在任何您喜欢的操作系统上都有一个本机外观的应用程序。
#15
0
I'm planning to do a similar thing, and I'm considering creating a C#/.NET Windows application and then porting it to OS X using Mono. My application already has a completely (except for the title bar and corner buttons) custom-drawn user interface, so the cosmetic OS differences shouldn't affect me too much.
我正计划做类似的事情,我正在考虑创建一个c# /。NET Windows应用程序,然后使用Mono将其移植到OS X。我的应用程序已经有了一个完全定制的用户界面(除了标题栏和角落按钮),所以外观操作系统的差异不会对我有太大的影响。
I'm not sure what you mean by leveraging the best of each platform in terms of frameworks and APIs and so forth. In general, writing a cross-platform application means writing to a least common denominator, and thus means not getting the best out of each platform.
我不确定您在框架和api等方面利用每个平台的优点是什么意思。一般来说,编写跨平台应用程序意味着编写一个最小公分母,因此意味着不能充分利用每个平台。
#16
0
Java or Mono come to my mind. Some people may argue that java graphical toolkits are not the cuttest out there but it seems to be, at least to me, the easiest way to port your application to several platforms and avoid deployment difficulties.
我想到了Java或Mono。有些人可能会说,java图形工具包并不是最简单的,但至少对我来说,它是将应用程序移植到多个平台并避免部署困难的最简单的方法。
Mono, on the other hand, could be a little bit more difficult to port as you would have to write at least the gui twice if you plan to have native widgets (either winforms or GTK for windows and CocoaSharp for Max) but you could write the backend only once and develop a frontend for each platform.
Mono,另一方面,可能更难以港口至少您必须编写gui两次如果你计划有本地小部件(winforms或GTK为windows和CocoaSharp Max)但是你可以只写一次后端和前端开发为每个平台。
As I said, Java GUI toolkits might not feel "native" inside OSX or even on Windows but they sure work on both platforms, you could use either Swing or AWT.
正如我所说的,Java GUI工具包可能不会在OSX内部甚至Windows中感到“原生”,但它们肯定在两个平台上都能工作,您可以使用Swing或AWT。
As for mono, you can use GTK or Winforms for both windows and OSX but they still will not feel native, you can, however use CocoaSharp which are bindings to the Cocoa framework but Im not sure about the status of the project (read: functionality support)
至于mono,您可以对windows和OSX都使用GTK或Winforms,但它们仍然不会让人觉得是原生的,但是可以使用与Cocoa框架绑定的CocoaSharp,但我不确定项目的状态(阅读:功能支持)
#17
0
I second Java. It is designed as a cross-platform solution.
我第二个Java。它被设计成一个跨平台的解决方案。
Others have mentioned Adobe Air.
其他人提到了Adobe Air。
Similar to Adobe Air is Silverlight. I believe it is (or will be) completely cross platform.
与adobeair相似的是Silverlight。我相信它是(或将是)完全跨平台的。
#18
0
You can create fantastic looking cross platform applications with Java Swing. It just requires slightly more effort to learn to do so.
您可以使用Java Swing创建漂亮的跨平台应用程序。这只需要稍微多花点功夫就能学会。
Here, take a look at some of these links.
这里,我们来看看这些链接。
- http://jidesoft.com/products/component.htm
- http://jidesoft.com/products/component.htm
- http://www.xerto.com/imagery.php
- http://www.xerto.com/imagery.php
- http://www.jgraph.com/screenshots.html
- http://www.jgraph.com/screenshots.html
- http://www.javootoo.com/
- http://www.javootoo.com/
- http://www.formdev.com/screenshots/
- http://www.formdev.com/screenshots/
- http://www.jidesoft.com/products/oss.htm
- http://www.jidesoft.com/products/oss.htm
#19
0
The guys at Magnetism Studios have a nice write up on using Cocotron to build a Windows executable with Xcode.
磁性工作室的工作人员写了一篇关于使用Cocotron构建Windows可执行文件的文章。
I have no experience with Cocotron, but if I needed to write a windows app —with a Mac development background— this would be the first thing I'd try.
我没有使用过Cocotron的经验,但如果我需要编写一个windows应用程序——有Mac开发背景——这将是我尝试的第一件事。
#20
0
If you choose C++ language, I would definitely recommend Qt for that. Your application can be deployed under Windows and Mac as requested in the OP, but also Linux, and now, with the latest version on smartphones using iOs, Windows RT and Android.
如果你选择c++语言,我肯定会推荐Qt。您的应用程序可以按照OP的要求部署到Windows和Mac下,也可以部署到Linux下,现在还可以部署到使用iOs、Windows RT和Android的智能手机上。
It's well documented and very active on the web (including on SO).
它在web上有很好的文档记录和非常活跃的功能(包括它)。
The only negative point I see is Qt creator tool which, IMHO, is less user friendly than historical tools (like Visual Studio for instance ), but you are not actually forced to use it as an IDE for Qt development.
我看到的唯一的缺点是Qt creator工具,IMHO比历史工具(例如Visual Studio)更不友好,但实际上您并不需要将它用作Qt开发的IDE。
#21
0
For completeness, it's now worth adding Unity to the list.
为了完整性,现在值得在列表中添加Unity。
It would be very hard to create a native-looking app for either platform and the general GUI tools are far from mature. But, it's not just a game engine and you can write in C#/Mono, make use of a decent range of libs and deploy to Win and OSX fairly painlessly.
要为任何一个平台创建一个外观像本地的应用程序都是非常困难的,而且一般的GUI工具还远没有成熟。但是,它并不仅仅是一个游戏引擎,您可以使用c# /Mono编写,使用一系列不错的libs,并部署到Win和OSX上,相当轻松。