Re: compile Gtk+ app with all deps



On Sat, May 19, 2007 at 11:12:51PM -0400, brad smith wrote:
> I have a Gtk+ that I made in glade. All works fine except the glade
> file has to be in the folder of the binary to work.

I would definitely not expect glade files in /usr/bin.

> Is there a way to
> static link the glade file so you could make a launcher on the desktop
> or menu option for application.

Glade file is just some text, so while there can be more
sophisitcated methods, you can make a C string from it with
a simple script like

perl -0777 -pe 's/["\\]/\\$&/g;s/^\s+</</gm;s/[^>]$/$&\\n/gm;s/^.*$/"$&"/gm;s/\A/const gchar foo_gxml_text[] =\n/;s/\Z/;/' foo.glade >foo.c

and compile foo.c into your program.

Yeti

--
http://gwyddion.net/



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