I made a structured GUI for DarkPlaces, that can handle windows/buttons/editfields/ect...
All objects are placed in a tree structure, so it can handle child objects (like a button in the window) and you can add custom events to all object (at onMousePressed/Released).
I tried to make the whole "GUI object" creation/customization simple as I can. For example this creates a window:
void() createWindow = {
entity window, button;
window = createGuiObj(world/*this is the parent*/,"window1"/*this is the ID*/ );
window.text = "Your First Window"; //The title
window.position = '10 10 0';
window.size = '120 80 0 ';
window.onMousePressed = dragMove_Start;
window.onMouseReleased = dragMove_Finish;
//it's now "draggable"... Yeah

button = createGuiObj(window, "Button1"); //spawns Button1 as the child of Window
button.text = "BuTtOn";
button.position = '10 10 0'; //Relative to the window...

button.size = '50 20 0';
button.onMouseReleased = yourFunctionThatDoWhatYouWant;
}
The whole thing is available to download with source at:
http://gprograms.co.cc/
There's also a video:
http://www.youtube.com/watch?v=RVgPOkGL0u0
I think this stuff can be useful for somebody who want handle a little bit more advanced GUI, but send me a feedback.
Btw, it's in an early stage, it's not well documented, and far from complete...
(and sorry for the bad english)