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

Problems with callback functions...



I'm kind of new to all this, sorry for all the mail =)  Anyways, I built
a property box in Glade, we'll call it PropertyBox to make things
simple.  Then, I attached a function for the "changed" event of my
editable text box, and told Glade to pass in as an Object the
PropertyBox, spelled just like that.  Inside this function that responds
to the changed event, I'm trying to call gnome_property_box_changed()
which needs a property box as a parameter.  Well, my function that's
doing this responding takes a gpointer as it's data.  And, in the
interface.c file, the signal connect code looks like:

gtk_signal_connect_object (GTK_OBJECT (myEditBox), "changed",
                             GTK_SIGNAL_FUNC (on_myEditBox_changed),
                             GTK_OBJECT (PropertyBox));

so the PropertyBox *is* being passed to my function, but as a
GTK_OBJECT.  So I assume that in my on_myEditBox_changed function
everything's going fine and in some form or another I have my property
box.  My problem is how do I pass this in to
gnome_property_box_changed()??  How do I convert this gpointer that my
function takes into a GnomePropertyBox*?  I tried just doing a type
caste: 
(GnomePropertyBox*)user_data, but Gnome complains:

GnomeUI-CRITICAL **: file gnome-propertybox.c: line 314
(gnome_property_box_changed): assertion `GNOME_IS_PROPERTY_BOX
(property_box)' failed.

How can I pass in my property box to this callback function so that I
can call the gnome_property_box_changed() method and enable the "apply"
button?  Thanks for your time.

-- 

<signature>

Jeff W., ICQ# 17989474

Change is inevitable.
"We are what we repeatedly do" - Aristotle

http://www.geocities.com/SunsetStrip/Alley/3450/index.html
http://minimal.ath.cx

</signature>



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