问题
I may need to build a GTK GUI using C# and Mono. If I understand correctly, that means I have 3 choices:
Write the C# code to call the GTK# wrapper classes. GUI is "in the code".
Use MonoDevelop GUI designer. This builds an interface using the stetic markup. I appears to just be XML.
Use Glade and libglade to create the GUI and load it at runtime.
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.
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?
Finally, it would be nice if development for this project could take place on Windows, Linux, and Mac OS X.
回答1:
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.
来源:https://stackoverflow.com/questions/4743512/gui-building-with-gtk