我应该重写了GTK +,而不是对的WinForms GUI单? [英] Should I rewrite GUI with GTK+ instead of WinForms for Mono?

查看:197
本文介绍了我应该重写了GTK +,而不是对的WinForms GUI单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在与Visual Studio,的WinForms应用程序,我使用openTK。最近,我想过使得跨平台的。我将使用单声道的,因为我不知道别的相似。而且我有GTK +完全没有经验。在我的应用程序,目前有4个窗口(当然还有今后将更多)。我想提出申请快Windows,Linux和OS X.我已阅读,GTK +比的WinForms好,但仍然不知道选哪个。所以,我要重拍家居GTK +或留的WinForms和为什么?此外,有没有任何工具,它会为我做这项工作?

I was making an application with Visual Studio, winforms and I'm using openTK. Recently I thought about making it cross-platform. I'm going to use Mono, because I don't know anything else similar. And I have totally no experience with GTK+. In my application, currently there are 4 windows(of course there will be more in future). I want to make application fast in Windows, Linux and OS X. I have read, that GTK+ is better than WinForms, but still not sure which to choose. So, should I remake everything for GTK+ or stay with WinForms and why? Also, is there any tool, which would do this work for me?

推荐答案

老实说,你将需要告诉我们更多关于您的观众的/目标市场提供了极大的答案,但我的$ 0.02,从一些经验发展存在着GUI开发单在桌面上是一个多目标的事情,如果你想这样做对。你将需要开发共享后端格外模块化,然后写UI每个平台的一次。

Honestly, you're going to need to tell us more about your audience/intended market to provide a great answer, but my $0.02 from some experience developing there is that GUI development for Mono on the desktop is a multi-target affair if you want to do it "Right". You're going to need to develop the shared backend exceptionally modularly, and then write UI once per platform.

的Windows

Windows.Forms的作为单实施是一个伟大的拐杖,如果您的应用处于起步阶段,让您以适用于Windows的立即的并在OS有点残缺的方式部署X和Linux操作系统。但是请注意,我已经被告知在IRC上单Windows.Forms的发展基本上是死了。旧的错误没有得到更新,并作为例如,我碰到的SelectionBackColor在RichTextBox中不能正常工作在OS X(它在一个lib单问题用来在OS X Windows.Forms的)测试在几分钟之内。整齐的,它的存在,也许是快速的实用程序,您可以编写围绕它的局限性好(这里见问题的例子)。

Windows.Forms as implemented on Mono is a great crutch if your app's in its infancy, allowing you to target Windows immediately and deploy in a somewhat crippled fashion on OS X and Linux. Note, however, that I've been told on IRC that Windows.Forms development on Mono is essentially dead. Old bugs don't get updated, and, as a for instance, I ran into SelectionBackColor not working in RichTextBox on OS X (it's a problem in a lib Mono uses for Windows.Forms on OS X) within a few minutes of testing. Neat that it's there, perhaps good for quick utilities where you can code around its limitations (see question here for an example).

OS X

有关针对OS X,如果你有一个真正的商业,最终用户的应用程序,你将需要习惯,嗯,有接口Interface Builder中的。 我要明确这里使用Xcode和Interface Builder的绝对需要的,你必须访问运行OS X的框。,否则,你坚持Windows.Forms的,或者,最好,我想,GTK#。

For targeting OS X, if you have a real, commercial, end-user app, you're going to need to get used to, um, interfacing with Interface Builder. I should make clear here that using XCode and Interface Builder absolutely requires that you have access to a box running OS X. Otherwise, you're stuck with Windows.Forms or, preferably, I think, Gtk#.

Xamarin已经做了伟大的工作,使得其IDE存根到内置的XCode原生用户界面的连接。这就是他们如何做到这一点的iOS开发也是如此。它的工作原理相当不错,虽然文档较弱。有href=\"http://mjhutchinson.com/journal/2011/06/monomac_video_ndc_2011\"从2011年rel=\"nofollow\">伟大的视频迈克尔Hutchingson描述这个过程一个直接链接到视频)

Xamarin has done a great job making its IDE stub out connections to native UIs built in XCode. That's how they do it for iOS development as well. It works fairly well, though the documentation is weak. There's a great video from 2011 from Michael Hutchingson describing this process, though I suppose it's getting long in the tooth (ie, "old"). (Direct link to video)

我假设Interface Builder的也是你唯一真正的选择,如果你想针对Mac App Store的。但是你看,这是一个的存根到您的C#代码,这一点,所有的事情考虑,一个伟大的妥协的原生UI。

I'm assuming Interface Builder is also your only real choice if you want to target the Mac App Store. But look, it's a native UI that's stubbed to your C# code, which is, all things considered, a great compromise.

的Linux

我还没有真正有针对性的Linux操作系统。好像Gtk#的将是一个天作之合,但我没有太多的动手帮助那里。我的东西在构建Windows.Forms的,有粗糙的边缘,就像在OS X.如果我得到了比较严重,我就开始与Gtk#的,而这也正是MonoDevelop中有其GUI RAD为好。

I haven't really targeted Linux. Seems like Gtk# would be a natural fit, but I'm not much hands-on help there. My stuff builds in Windows.Forms, and there are rough edges, just like in OS X. If I got more serious, I would start with Gtk#, and that's where MonoDevelop has its GUI RAD as well.

严重的,成熟的,跨平台的Gtk#应用程序示例

快速注:的女妖使用 Gtk#的目标OS X中,Windows(阿尔法)和Linux。你可以得到它是多么的困难被检查出的的邮件列表和其他资源。

Quick note: Banshee uses Gtk# to target OS X, Windows (alpha), and Linux. You can get some great context for how difficult it is to use Gtk# on a large application cross-platform by checking out its mailing list and other resources.

对不起这个消息没有任何容易。有没有银弹/唯一正确的答案

Sorry the news isn't any easier. There is no silver bullet/single right answer.

201607更新:我想答案正在慢慢地变得使用Xamarin.Forms目标跨平台的。你可能仍然被卡住写,现在一个单独的Mac界面,但我们有理由相信,将有Xamarin.Forms在某些时候太支持;请看下文。

201607 UPDATE: I think the answer is slowly becoming to use Xamarin.Forms to target cross-platform. You might still be stuck writing a separate Mac interface for now, but there's reason to believe that'll have Xamarin.Forms support at some point too; see below.

不幸的是,如果你的目标的Linux,我想你还是在同一条船上,你之前吧。

Unfortunately, if you're targeting Linux, I think you're still in the same boat as you were before for now.


  • 视窗:您现在可以使用的 Xamarin.Forms和UWP

  • 的MacOS:你仍然在本质上是相同的地方,但我有一个Xamarin的员工告诉我,上周末Xamarin。形式是非官方发展为OS X的,我相信这是在GitHub上回购。 (甚至还有tvOS一个分支。)

  • Windows: You can now use Xamarin.Forms and UWP.
  • macOS: You're still in essentially the same place, but I had a Xamarin employee tell me last weekend that Xamarin.Forms is unofficially in development for OS X. I believe this is the repo on GitHub. (There's even a branch for tvOS.)

这篇关于我应该重写了GTK +,而不是对的WinForms GUI单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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