Help casting void pointer to GtkWidget
- From: Patrick <patrick spellingbeewinnars org>
- To: "gtk-list gnome org" <gtk-list gnome org>
- Subject: Help casting void pointer to GtkWidget
- Date: Sun, 19 Jul 2015 15:15:31 -0400
Hi Everyone
I am doing something strange. I am mixing C GTK and COBOL. It's GnuCOBOL
and it compiles to intermediate C.
I can create widgets by creating pointers in COBOL and passing them to C
GTK functions and such but I can't seem to connect signals.
This code:
int sig_con1( GtkWidget * widget_id ) {
g_signal_connect(G_OBJECT(widget_id),"clicked",
G_CALLBACK(handler1_to_handler2),NULL);
.....
compiles but when it runs I get :
(anak:18978): GLib-GObject-WARNING **: invalid unclassed pointer in cast
to 'GObject'
(anak:18978): GLib-GObject-WARNING **: instance with invalid (NULL)
class pointer
COBOL is actually passing in a void pointer so widget_id is actually
type void. I can't seem to cast it to a pointer to a G_OBJECT. Changing
the functions prototype to void * widget_id did not help.
Could anyone give me a tip or two of how to cast ?
Thanks-Patrick
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]