Question

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 each 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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top