开发者

gtk+ Gtkbuilder && OOP principles

I got a pretty awkward feeling after messing with GtkBuilder + *.ui-files for a few weeks now.

Either I doom the OOP principles to get a real advantage from the usage of GtkBuilder and *.ui files OR if I do not want to drop the OOP design, I get so much overhead by GtkBuilder it makes it not worth using it at all.

Just an example: IDE - The mainwindow, either make it one big UI file or make it many parts (separate files for e.g. Toolbar开发者_运维问答, Statusbar, SourceView, etc..) but with a awefull lot of more code to do around the builder.

Can anybody explain me how to get that below one hat? I was not able to find sufficient tutorials on best practice for GtkBuilder/*.ui-files.


After soe months playing with gtk+, I think I got the answer myself: Subclass functional chunks and provide for these functional classes/chunks a seperate .ui file. These part .ui files are best assembled by hand, for more fine grained control to create a seamless application.

Gnerally make the .ui files cover as few as necessary to keep the chunks a) reusable and b) functional for one purpose. Hope this helps someone else too.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜