tags:

views:

142

answers:

4

Hello,

For my school project, I would like to build a gui that someone else can use to create a gui. Upon some research I saw lot of gui builders but didn't see anything along the lines of what I am looking for.

But then I did find a tutorial using C# on here

I rather create this gui editor for linux environment.

Any suggestions to where I should start? what tools I can use? Any links to any tutorials?

Any help/direction would be greatly appreciated.

P.S. I would like to add that it only needs to be very simple. like few text input fields and some button type fields that user can arrange in the order desired.

+5  A: 

I would recommend that you not try to build your own GUI builder. It is a daunting task that you will not be able to accomplish as a school project. C++ is fully-compiled, which means that it lacks almost every feature that enables people to build meta-tools (like GUI editors) for it. This mainly has to do with the fact that C++ does not have runtime reflection (natively, anyway). Beyond that, there is no "one GUI toolkit and/or paradigm to rule them all." This makes your problem incredibly difficult to deal with.

So: I would recommend Qt, because it works on a ton of platforms, is easy to use and is just plain awesome. You could also look at the billions of other GUI toolkits like Gtk+, Tk, FLTK, YAAF, GLUI, dlib, CLX...

I'm aware that this does not actually answer the question. However, I do not think that the author is aware of how incredibly difficult the task he has set in front of himself is.

Travis Gockel
I dunno. I think if the XML format for Gtk is decently documented (assuming that), then you could probably write up something workable that assume a gridbag layout, and only supports a dozen or so targets.I don't think it would be the quality of Glade, but it shouldn't be impossible.
sharth
You should look into how long Glade took to develop. And it was made with people who were quite familiar with GTK and the GType system.
Travis Gockel
+1: Writing a GUI Editor is a massive task. I recently needed a customisable GUI, so I used Qt Creator to create .ui files and these can be imported as a "widget" into your own Qt program to use as you wish.
Al
A: 

I don't have any exact links to this, but here's an example of what you could do. Gtk has the option of loading a GUI by using a class called GtkBuilder. Glade (the usual Gtk gui editor) has support for outputting it's result as an XML file that the GtkBuilder class then reads.

It would be possible for your program to output an equivalently formed XML file that GtkBuilder could read.

I have no clue as to how difficult it would be to target that XML though.

sharth
A: 

You should use GTK+ or Qt if you are targeting the linux environment. I think the first step is to learn how to program gui, which takes some time considering you are writing c/c++ code wich is different from higher level languages. Don't you think learning to code gui programs and writing a gui builder at the same time is a little bit too much.? First you should master the basics about gui and then go on to harder projects.

Here's a link to an excellent book on gtk. (Foundations of gtk+ development - Andrew Krause)

http://books.google.com/books?id=L1BZZYRrqSgC&printsec=frontcover&dq=foundations+krause&hl=es&cd=1#v=onepage&q=&f=false

And here's a great tutorial/cookbook for gtk+.

http://zetcode.com/tutorials/gtktutorial/

The official documentation is on library.gnome.org

My final advice is learn one thing at a time.

dallen
+1  A: 

I would recommend starting by implementing it like an interpreter. Start with a very simple command line tool that takes commands like window(300, 400, "window1") and button(50,100, "button1") etc and output the code (native or whatever other GUI code you want), to a file. The goal should be to output a file that can be run and show the GUI that was designed. Once you have that, build a GUI that uses the command line functions as a back-end.

Graphics Noob