开发者

Writing my first gtk program, what's the best way to use glade?

I've been reading tutorials, but one thing I'm not seeing is this: If you're writing a complex application where new windows pop up as a result of button clicks on a main window, should ea开发者_StackOverflow中文版ch top level window be a separate glade file, or is there a way to keep all the interface design in one glade file? If so, how do you do that? The glade inspector window seems to show one big hierarchy for everything in the current file.

Or if you have a modal window created as a result of a button click on a main window, can that be in the same glade file too?


If you aren't already, you should use the latest version of glade3 and the GtkBuilder format instead of the old libglade format. If your app is complex you will probably want to split your interface into multiple files. The thing to keep in mind is that everything in a file is loaded and set up at once. If you could have multiple instances of a given widget hierarchy or if you will need to configure a set of widgets specially each time they are used they should go in their own file.

If you haven't seen this tutorial and this Glade/GtkBuilder FAQ you should definitely give them a read.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜