I'd recommend checking out the APIs for GUIs such as the KDE and Gnome for Linux.
I wrote a C++ GUI using a graphics library I wrote (check out
www.neuraldk.org for more info... downloads->smoke). It's not perfect (I wrote it years ago, and desperately needs updating, but it'll probably give you a basic idea).
My concept for a GUI is similar to Gnome's, I think (or java):
myWindow = new Windows;
myTable = new Table(rows, columns);
myTable.add(new Button(etc));
myTable.add(new Picture(etc));
myWindow.add(myTable);
and so on...
essentially, you simply add GUI elements to a window object, and formatting objects (such as "Table") control where they go... a table, for example, would give each element equal space on the screen, unless told otherwise (much like the <table> construct of html).
Also for formatting, you could add spacer objects, and so on.
I'd elaborate more, but... well, I'm drunk
Head's buzzin, so I really shouldn't get into detail. I'll try and post a better explanation later, but for the time being, check out smoke on
www.neuraldk.org Might help out.
j.