GUI构建与GTK# [英] GUI building with GTK#

查看:329
本文介绍了GUI构建与GTK#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可能需要使用C#和Mono建立一个GTK图形界面。如果我理解正确的话,这意味着我有3个选择:

I may need to build a GTK GUI using C# and Mono. If I understand correctly, that means I have 3 choices:


  • 编写C#代码来调用GTK#包装类。 GUI是代码。

  • Write the C# code to call the GTK# wrapper classes. GUI is "in the code".

使用MonoDevelop的GUI设计器。这将构建使用stetic标记的接口。我似乎只是XML。

Use MonoDevelop GUI designer. This builds an interface using the stetic markup. I appears to just be XML.

使用格莱德和libglade的创建GUI并在运行时加载它。

Use Glade and libglade to create the GUI and load it at runtime.

我有MonoDevelop中的图形用户界面编辑器中的一点经验。这是很好的,但有一些粗糙的边缘。我能想象需要手动编辑在某些时候stetic标记。

I have a little experience with MonoDevelop's GUI editor. It's nice, but has a few rough edges. I can imagine needing to hand edit the stetic markup at some point.

我也用在格莱德使用Python ...

I've also used Glade in the past with Python...

这两个项目只是实验性质,所以我真的想从别人以前已经并肩作战听到。有哪些优点和缺点每个?

Both of these projects were experimental in nature only, so I'd really like to hear from someone that has fought this battle before. What are the advantages and disadvantages of each?

最后,这将是很好,如果该项目的开发可能发生在Windows,Linux和Mac OS X。

Finally, it would be nice if development for this project could take place on Windows, Linux, and Mac OS X.

推荐答案

在过去,MonoDevelop的的设计师GTK是可怕。今天,它是一个用于构建丰富的GUI非常坚实的(不完全,但很扎实)解决方案。这是所有平台的最佳选择。通过代码构建GUI会变得非常痛苦。在另一方面使用Glade的是一种快乐,但你有一些缺点。这些缺点涉及在控件上的一些有限的选择在像窗口等设置不透明度运行,因为你需要加载的格莱德命名空间中的XML文件格莱德。当然,总有导入格莱德文件在你的项目,但它从来没有为我工作的选项。

During the old days, the MonoDevelop GTK designer was awful. Today, it is a very solid (not completely but very solid) solution for building rich GUIs. It is the best option for all platforms. Constructing a GUI through code can become quite painful. Using Glade on the other hand is a joy but you have some drawbacks. These drawbacks concern some limited options on your controls at runtime like setting Opacity on windows etc, because you need to load the XML Glade files with the Glade namespace. Of course, there is always the option of importing the Glade files in your project but it never worked for me.

这篇关于GUI构建与GTK#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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