Re: Libglademm and Glademm code for Gtkmm



Paul Davis wrote:


It might be possible to do something with includes to make this a buffer. The hardest thing would be doing proper escaping. Does anyone know off hand if valid XML must replace the " character.... what am I talking about, of course its common as crap. Its too late. Anyway, if anyone can think of a way to do this, let me know. It would be neato.


I've thought about this problem too, and I haven't been able to come up with any #include tricks to make this work. My next idea is to try to use the reswrap tool which is shipped with fox-toolkit (www.fox-toolkit.org). reswrap takes a file and generates a C char array which is a byte-by-byte representation of your file suitable for #including (similar to an XPM). It's easier to show than explain.

One of the examples from the libglademm distribution generated this:

/* Generated by reswrap version 3.1.0 */

/* created by reswrap from file example.glade */
const unsigned char example[]={
0x3c,0x3f,0x78,0x6d,0x6c,0x20,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x3d,0x22,0x 0x2e,0x30,0x22,0x20,0x73,0x74,0x61,0x6e,0x64,0x61,0x6c,0x6f,0x6e,0x65,0x3d,0x 0x6e,0x6f,0x22,0x3f,0x3e,0x20,0x3c,0x21,0x2d,0x2d,0x2a,0x2d,0x20,0x6d,0x6f,
 ...
 0x64,0x65,0x2d,0x69,0x6e,0x74,0x65,0x72,0x66,0x61,0x63,0x65,0x3e,0x0a
 };

The preferred way to use it would be to make a custom build step to generate a C file (let's call it gladedata.cc) from your *.glade file, then compile the gladedata.cc into your executable and load it with Xml::create_from_buffer().

*disclaimer* I've never done this, so I can't say for SURE that it works. Although it seems like it should and you should try it let us know :)

From some quick googling, it looks like reswrap is packaged standalone for gentoo, it might also be packaged for Debian/apt. I put a windows binary here: www.signal11.us/~alan/reswrap.exe for convenience (if you're into downloading and running EXEs off the internet from strangers).

Alan.





Arthur wrote:

Hey, guys, if anyone could give me a hint about if there is any advantage of using only libglademm when working with gtkmm, instead of using Glademm generated code, I would be very pleased. Could you send me any reading reference about it?

Thank you in advance.

Arthur Maciel
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list



_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]