Re: Help casting void pointer to GtkWidget

Well, you're passing something that isn't a GtkWidget to sig_con1. The
type of the pointer should not matter as long as it points to a
GtkWidget (some secret sauce under the hood is used to know whether
it's a valid pointer or not).

We would need to see what calls sig_con1 to debug further, but look there.

On Sun, Jul 19, 2015 at 12:15 PM, Patrick
<patrick spellingbeewinnars org> wrote:
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 ) {

compiles but when it runs I get :

(anak:18978): GLib-GObject-WARNING **: invalid unclassed pointer in cast to

(anak:18978): GLib-GObject-WARNING **: instance with invalid (NULL) class

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 ?


gtk-list mailing list
gtk-list gnome org


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