Re: gtk_signal_connect_object



Shadia Mikhael wrote:

Hello, i'm still a beginner in gtk...and i'd like to ask for some help. I'm trying to create a simple window which enables the user to select a file he/she wants to open..however i'm getting an error while compiling in the line which ensures that the dialog box is destroyed when the user clicks a OK/Cancel.

GtkWidget *file_selector;

gchar *selected_filename;

gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION(file_selector)->ok_button),"clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy),(gpointer)file_selector);

the error is the following:

error C2664: 'gtk_signal_connect_object' : cannot convert parameter 4 from 'void *' to 'struct _GtkObject *' . Conversion from 'void*' to pointer to non-'void' requires an explicit cast

The fourth parameter is of type GtkObject*. Make a cast like (GtkObject*)file_selector or
(if you dont bother about CPU time wasting) use GTK_OBJECT() macro.

This code is what i found in one of the tutorials..is the error due to the fact that my operating system varies from that of the author?

Looks like this, what compiler are you using ?

Olexiy




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