After examining the program a bit with gdb, the error is coming from a bad pointer.
GtkWidget * gens_window = NULL;
>> Is currently defined globally which is ok I suppose.
in src/gens/emulator/g_main.c on line 856 it is suppose to get set to a new value
gens_window = create_gens_window();
>>create_gens_window() gets called from /src/gens/gtkui/glade/interface.c(or .h if you prefer the headers)
>>the function returns the GtkWidget * window variable
>>however it gets set to NULL by gtk_builder_get_object(builder, "gens_window") function when it should be returning a valid pointer.
So that NULL value get's returned and assigned to gens_window.
which breaks
g_object_set_data_full(G_OBJECT(gens_window), "sdlsock", g_object_ref(sdlsock), (GDestroyNotify) g_object_unref);
because it passes in the NULL value
It also breaks
gtk_box_pack_end( GTK_BOX(lookup_widget(gens_window, "vbox1")),
sdlsock, 0, 0, 0);
and last but not least
gtk_widget_show(gens_window);
I haven't been able to figure out why gtk_builder_get_object(builder, "gens_window") in the interface.c file is returning NULL other than the fact it can't find a label called gens_window
Gets the object named name. Note that this function does not increment the reference count of the returned object.
builder :
a GtkBuilder
name :
name of object to get
Returns :
the object named name or NULL if it could not be found in the object tree. [transfer none]
After examining the program a bit with gdb, the error is coming from a bad pointer.
GtkWidget * gens_window = NULL;
>> Is currently defined globally which is ok I suppose.
in src/gens/ emulator/ g_main. c on line 856 it is suppose to get set to a new value gens_window( ); gens_window( ) gets called from /src/gens/ gtkui/glade/ interface. c(or .h if you prefer the headers) get_object( builder, "gens_window") function when it should be returning a valid pointer.
gens_window = create_
>>create_
>>the function returns the GtkWidget * window variable
>>however it gets set to NULL by gtk_builder_
So that NULL value get's returned and assigned to gens_window.
which breaks set_data_ full(G_ OBJECT( gens_window) , "sdlsock",
g_object_ ref(sdlsock) , (GDestroyNotify) g_object_unref);
g_object_
because it passes in the NULL value
It also breaks
GTK_BOX( lookup_ widget( gens_window, "vbox1")),
gtk_box_pack_end(
sdlsock, 0, 0, 0);
and last but not least show(gens_ window) ;
gtk_widget_
I haven't been able to figure out why gtk_builder_ get_object( builder, "gens_window") in the interface.c file is returning NULL other than the fact it can't find a label called gens_window
gtk_builder_ get_object () ------- ------- ----- get_object (GtkBuilder *builder, const gchar *name);
-------
GObject * gtk_builder_
Gets the object named name. Note that this function does not increment the reference count of the returned object.
builder :
a GtkBuilder
name :
name of object to get
Returns :
the object named name or NULL if it could not be found in the object tree. [transfer none]