How to load glade XML file in user space project created in the STM32 Cube IDE?
I am trying to build gui using GLADE designer for STM32 MP157 DK but i have problem in loading the generated GLADE XML in user space project.
I am trying to build gui using GLADE designer for STM32 MP157 DK but i have problem in loading the generated GLADE XML in user space project.
Yes I understand. The problem is function call gtk_builder_add_from_file (GtkBuilder *builder, const gchar *filename GError **error ); Expects a filename that can be looked up in a file system.
Since you do not have a file system, you need to be using gtk_builder_add_from_string (GtkBuilder *builder const gchar *buffer gsize length GError **error ); which expects a pointer to character array with the array size of the character array. Follow these steps
Take the GLADE file you already have (I think you callled it "mygui.glade") and make is into a C array using the srec_cat utility, with the command line
srec_cat mygui.glade -Binary -o mygui.h -C-Array mygui_glade
This will produce a file called mygui.h containing a C array called mygui_glade There will also be a constant defining the size in the same H file
Now include the H file in your C code, and add the call gtk_builder_add_from_string (Builder, mygui_glade, mygui_glade_size, error); in all places where you called gtk_builder_add_from_file previously,
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.