views:

318

answers:

2

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?

+1  A: 

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.

Matthew Talbert
I've used GtkBuilder with glade 3, and it's very nice. The main problem for me is that I have to edit it with a separate application (Glade 3 vs whatever text editor/IDE I'm using). This is especially annoying when I just want to check something simple, like the name of a widget.
Matthew
You can always open the GtkBuilder file in your editor, I suppose. It would probably be just as easy as figuring out which widget does what in code (it can get quite confusing there without seeing a graphical overview).
Matthew Talbert
+1  A: 

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.

Alexey Yakovenko