tags:

views:

317

answers:

2

I am looking for tool that can convert .Glade (or xml) file to C source.
I have tried g2c (Glade To C Translator) but i am looking for windows binary.

Any one does know any good tool for window.

Thanks,
PP.

+1  A: 

glade2 works for me. though if you are using new glade3 features it won't help you..

Alexey Yakovenko
can you provide link to glade2 download, i can't find it anywhere. there are just glade3 links. i am looking for glade2 for window.
PP
try https://sourceforge.net/projects/gladewin32/files/(sorry if it doesn't work, i'm using linux)
Alexey Yakovenko
Thanks for link.
PP
+1  A: 

You don't need a tool. Just write a script in your favorite scripting language to format your glade file as a C string literal:

For example, let's call it glade_file.c:

const gchar *my_glade_file = 
    "<interface>"
        "<object class=\"GtkDialog\">"
            "<et-cetera />"
        "</object>"
    "</interface>";

Compile glade_file.c into your program, then do this when you build your interface:

extern const gchar *my_glade_file;
result = gtk_builder_add_from_string(builder, my_glade_file, -1, &error);
ptomato
I want to see the generated code. I have created one very complex composite widget in glade, and if I start implementing it by manual coding it will take somuch time. so I am looking for a converter that will given me source for this widget which I have created in glade.
PP
There is no generated code in Glade 3. If you already made the widget in Glade, why do you want to reimplement it manually??
ptomato
because i want to create a list of it.
PP
You can put the above code in the constructor of the widget, and then make a list of it...
ptomato