Re: [gnome-love] At last... I made it...



On Mon, 2004-06-14 at 21:36, Sean Middleditch wrote:


Eek.  No, *only* application binaries go in bin.  Data file resources
like glade files absolutely do not belong there at all, in any way. 
Should instead be somewhere like $prefix/share/wallpapoz/.  You can then
use a library like binreloc (http://www.autopackage.org) to locate the
correct folder and load the glade file at runtime.


The Makefile.am files take a list of files and the locations they should
be installed to.  For example, to put the .glade file in the correct
location, you'd have something like:

glade_DATA = wallpapaz.glade
gladedir = ${datadir}/@PACKAGE_TARNAME@/

@PACKAGE_TARNAME@ is expanded to the application name defined in
configure.in, which should in your case by wallpapoz.  ${datadir} should
be expanded to ${prefix}/share.  So in the above, automake will make it
so make install will put the wallpapoz.glade file in
/usr/share/wallpapoz/wallpapoz.glade, assuming you install to the /usr
prefix.

If for some reason you cannot use Binreloc and need to hard-code the
path (*please* don't do this if not necessary; hard-coded paths are the
devil and make it impossible to relocate your binaries), you'll need to
tell the app where to find the glade file.  To do this, add something
like -DDATADIR="${datadir}/@PACKAGE_TARNAME@" to your CFLAGS variable. 
Then you'll have the DATADIR macro in your code that points to the
proper directory, so you can find the glade file using DATADIR
"/wallpapoz.glade" in your code.
Ok, here's my code according to your suggestion:
string blabla = DATADIR + "/wallpapoz.glade"
refXml = Gnome::Glade::Xml::create( blabla );

So how do I define DATADIR in mycode? You said add something like "..."
to your CXXFLAGS variable. But when I search this string:
there are three files that have this variable:
Makefile.old, Makefile.in, configure.
I guess you don't want me to hack Makefile.old and configure script. I
doubt about Makefile.in. 

Ok, what about wallpapoz.desktop? How can I tell 'make install' to put
this stuff into /usr/share/applications. So that my program will be in
Gnome menu. 

Last. What about the icon for the program it self and for the menu? My
Glade file will search the icon in its directory. But when I look for
another GTK-program, usually they put their icon in /usr/share/pixmaps,
so I think I have to hard-code the path. How do I tell 'make install' to
put the icon into /usr/share/pixmaps.

Thank you.









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