[Glade-users] Problem with glade_xml_new_from_memory



Hi,


I'm having a hard time with glade_xml_new_from_memory.


I've got a glade file and I can load my gui with glade_xml_new.

Now I'd like to link this file into my exe and then use 
glade_xml_new_from_memory.

However, I always get a segfault at glade_xml_set_value_from_string when 
trying to load the gui with glade_xml_new_from_memory. (Top symbol on 
the stack when the segfault happens).

At first I thought that libglade might do something nasty (like write to 
the buffer) and thus copied the buffer to a new array twice the size of 
the actual data, but this didn't help either.

So, is there anything special to take care of when using new_from_memory?


I've got glade 2.10 and libglade 2.5.1.

Code snippets:


   gtk_init(&argc, &argv);
   glade_init();


   //xml = glade_xml_new("test.glade","main_window",0);

   xml = glade_xml_new_from_memory(buff,buff_size,"main_window",0);
   if (!xml)
   {
     g_warning("problem loading glade file");
     return -1;
   }
   connectAllSignals(xml);
   gtk_main();

The content of buff is fine (If I print it out its the same as the xml 
file's content) and the buffer is writeable (I memcpy to it from the 
mmaped test.glade file).

I'd really appreciate any help

kind regards Philip



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