issue trying to use GtkGrid verses GtkTable.



Hello. 

I apologize in advance if this is not the correct list.  I have a program that compiles and links.  At runtime it will instantiate instances of GtkTable but it hangs with the error messages below if I try to use a GtkGrid.  Here is the relevant section of the code.

container.cc 

//static method called first by the lv2 host.
static LV2UI_Handle instantiate(const struct _LV2UI_Descriptor * descriptor,
const char * plugin_uri, const char * bundle_path,
LV2UI_Write_Function write_function, LV2UI_Controller controller,
LV2UI_Widget * widget, const LV2_Feature * const * features) {
std::cout << "instantiate EMAP lv2 UI" << std::endl;

if (strcmp(plugin_uri, EMAP_URI) != 0) {
fprintf(stderr,
"SORCER_URI error: this GUI does not support plugin with URI %s\n",
plugin_uri);
return NULL;
}

gtk_init(0, NULL);

std::cout << "called gtk_init." << std::endl;

//allocate an emap instance.
EmapContainer* emap = new EmapContainer(NULL, true);

        std::cout << "instantiated EMAP lv2 UI" << std::endl;

return (LV2UI_Handle) emap;
}

//constructor called within instantiate above
EmapContainer::EmapContainer(fluid_synth_t* synth_new, bool is_lv2) {
       if(is_lv2){

            std::cout << "making EMAP container (fluidsynth UI)" << std::endl;

GtkWindow* emap2 = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL));
emap = emap2;

std::cout << "called gtk_window_new." << std::endl;

gtk_window_set_title(GTK_WINDOW(emap2),
"EMAP - Easy Midi Audio Production");

std::cout << "set title" << std::endl;

gtk_window_set_default_size(GTK_WINDOW(emap2), 400, 400);

std::cout << "set default window size" << std::endl;

/* deprecated
GtkWidget* container2 = gtk_table_new(2, 0, false);
std::cout << "made container2" << std::endl;
container = GTK_TABLE(container2);
*/
//Gtk::Grid* abc = new Gtk::Grid();

//std::cout << "made gtkmm grid" << std::endl;

container2 = gtk_grid_new();
                //this works...continer2 = gtk_table_new(1, 4, true);

std::cout << "application hangs on gtk_grid_new()" << std::endl;
       }
}

Here is what's displayed in the console.  

instantiate EMAP lv2 UI
called gtk_init.

(jalv.gtk:5033): GLib-GObject-CRITICAL **: g_object_set_qdata_full: assertion 'quark > 0' failed
making EMAP container (fluidsynth UI)
called gtk_window_new.
set title
set default window size

(jalv.gtk:5033): GLib-GObject-WARNING **: cannot register existing type 'GtkWidget'

(jalv.gtk:5033): GLib-GObject-WARNING **: cannot add class private field to invalid type '<invalid>'

(jalv.gtk:5033): GLib-GObject-WARNING **: cannot add private field to invalid (non-instantiatable) type '<invalid>'

(jalv.gtk:5033): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(jalv.gtk:5033): GLib-GObject-WARNING **: cannot register existing type 'GtkBuildable'

(jalv.gtk:5033): GLib-GObject-CRITICAL **: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed

(jalv.gtk:5033): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed

(jalv.gtk:5033): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(jalv.gtk:5033): GLib-GObject-CRITICAL **: g_type_register_static: assertion 'parent_type > 0' failed

(jalv.gtk:5033): GLib-GObject-WARNING **: cannot add private field to invalid (non-instantiatable) type '<invalid>'


Do you have any hints at what I can try to get the GtkGrid working? I'm trying to switch to this to this since GtkTable is deprecated.  

Thanks for your help.
Bill. 



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