Re: cannot launch project with glad file



On Fri, 2011-01-14 at 04:36 -0500, craigbakalian wrote:
  xml = glade_xml_new ("mLilyEditor.glade", NULL, NULL);

"myLilyEditor.glade" does not mean "in the same directory as the
executable" but "in the current working directory".

Usually you define a constant from your Makefile.am (e.g.
PACKAGE_DATA_DIR) and construct a full path with g_build_filename():

GladeXML *xml;
char *glade_file;

glade_file = g_build_filename (PACKAGE_DATA_DIR,
                               "myLilyEditor.glade",
                               NULL);
xml = glade_xml_new (glade_file, NULL, NULL);
g_free (glade_file);

Also note that libglade is deprecated and should not be used in new
projects - it is highly recommended that you use GtkBuilder instead (the
glade UI editor also supports that file type)





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