Re: invalid unclassed pointer?



On Wed, 23 Aug 2000, Dugas, Alan wrote:

> I've written a function that creates a window with a combo box and a drawing
> area.  The drawing area is connected to the "configure" and "expose" events and
> passes the GTK_WIDGET(combo) to the function called.  However, when the progam
> reaches the callback function, I keep getting the following message just prior
> to segfaulting;
> 
> Gtk-WARNING **: invalid unclassed pointer in cast to 'GtkCombo'.
> 
> The callback function is declared as:
> void draw_histogram(GtkWidget *calling_widget, GtkWidget *widget)

 It should be:
            gboolean  draw_histogram	   (GtkWidget *widget,
                                            GdkEventExpose *event,
                                            gpointer user_data);
 i.e. it should accept 3 params instead of two.
 
> The signal connections, which occur after the combo widget is created, realized,
> and shown, are as follows:
> gtk_signal_connect(GTK_OBJECT(drawing_area), "configure_event",
> GTK_SIGNAL_FUNC(draw_histogram), GTK_WIDGET(combo));
> gtk_signal_connect(GTK_OBJECT(drawing_area), "expose_event",
> GTK_SIGNAL_FUNC(draw_histogram), GTK_WIDGET(combo));
> 
> The line of code triggering the warning, and subsequent segfault, is:
> combo = GTK_WIDGET(combo);
> WHere combo is declared as follows:
> GtkWidget *combo;
> 
> I've tried to realize the GtkCombo widget to no avail and everything else looks
> proper.  What is warning trying to tell me?  Is this some sort of weird scope
> issue?  Any and all responses would be appreciated!
> 

 Best regards,
  -Vlad






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