Hello! I am going to write a simple layout system for a game GUI. I thought about the various layout systems used in GUI, such as absolute positioning, Java’s layout managers, springs and struts and the like. In the end I found out that I prefer the layout as viewed by CSS – padding, margin, floats, blocks, inlines, etc. Have you ever seen an application GUI done like this? Not a web application, but a “real” application where the CSS layout system must have been written from scratch. Do you think it possible to get a working and expressive CSS-like layout system, even if very simple, with a decent amount of code?
Update: I do not want to create the GUI from an external stylesheet. I would be happy with a runtime interface, ie. something like this:
Widget *container = [Container withWidth:100 height:100];
Widget *button1 = [Button withText:@"Foo"];
Widget *button2 = [Button withText:@"Bar"];
button1.floating = button2.floating = YES;
[container addObjects: button1, button2, nil];
Should have said that earlier, sorry.