3
votes

Glade helped me get started on a project quickly, but I've found it harder to maintain in the long run, and I'm thinking about switching it all to native code. In what circumstances would you choose glade, and when would you use native code?

2

2 Answers

4
votes

I would personally only use native code for performance reasons. I find it much easier to work with gtkbuilder. Have you used glade or gtkbuilder? With Glade 3, gtkbuilder format is easy to use and easy to layout and design. Also, gtkbuilder is easier to load widgets from than glade was.

2
votes

if by native code you mean "direct GTK calls to build ui", then i'd switch to it for several reasons:

  1. if widgets are built dynamically depending on user preferences, etc
  2. if i use a lot of custom widgets, esp. contained within each other (for example GDL docking panels)
  3. to maintain backwards compatibility with older version of GTK

upd: also i'm still using glade2.x which has code generation (patched it to compile against latest gtk2). it really helps to get quickstart on "gui build from code", and works with both ancient and newer GTK versions. though i'm afraid i will have some troubles porting to gtk3 :)

and i never choose gtkbuilder over other alternatives, 'cause it is not available in (still widespread) older GTK versions.. dunno if i'll ever switch to it.. maybe when gtk3 comes out.