Wednesday, June 01, 2005

Creating Glade, GTK# Mono GUI Apps

To compile a "foo.cs" file using the

mcs /unsafe /resource:foo.glade foo.cs -pkg:gtk-sharp-2.0 -pkg:glade-sharp-2.0


The "foo.glade" file was generted by Stetic and used by GladeStub.exe to create "foo.cs". This complile statement, and the various requirements and meaings, are found documented (somewhat) in this gotmono page.

Stetic, GTK# and GladeStub

Rafael Ferreira created a tool, which he describes on "Mono-List" as follows:



After talking about this little tool I had written on #mono the other
day I decided to package it up and put it out for anyone else that might
find it useful.

gladestub.exe is a very simple glade xml parser that generates a .cs
file with all of the widgets and signals ready for use.

Some shortcomings include (but are not limited to):
* not able to parse thought a glade file with multiple widget-roots.
* the generated code is kinda plain
* There's only 1 template to use - this could be easily extended
* Overwrites the .cs file every time it is run
* other stuff I can't think of right now.

Of course, this works for me (tm), your mileage may vary... and please
email me any questions/comments.

- Rafael

download it here:

http://ophion.org/~rafael/static/download/GladeStub.tar.bz2




It really is a nice tool, I must agree. Combined with Stetic, a IDE-like Designer for the GTK# toolkit this generator allows RAD using C#, Stetic, and in my case, MonoDevelop.