【发布时间】:2010-10-19 02:32:14
【问题描述】:
我将为游戏 GUI 编写一个简单的布局系统。我想到了 GUI 中使用的各种布局系统,例如绝对定位、Java 的布局管理器、spring 和 struts 等。最后我发现我更喜欢 CSS 所看到的布局——填充、边距、浮动、块、内联等。你见过这样的应用程序 GUI 吗?不是 Web 应用程序,而是必须从头开始编写 CSS 布局系统的“真实”应用程序。您是否认为有可能获得一个工作且富有表现力的类 CSS 布局系统,即使非常简单,但代码量可观?
更新:我不想从外部样式表创建 GUI。我会对运行时界面感到满意,即。像这样:
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];
早该这么说的,抱歉。
【问题讨论】:
标签: css user-interface