Re: Using arguments in callbacks



On Wed, 23 Mar 2005 12:39:55 -0500
Irwin Michael G DLVA <IrwinMG NSWC NAVY MIL> wrote:

Thanks, but this doesn't seem to help.  I typed GINT_TO_POINTER(1) in
the object box, so that the .glade file looks like this:

...
<child>
  <widget class="GtkToggleButton" id="trajectoryTB">
    ...
    <signal name="toggled" handler="trajectoryCb" after="yes"
object="GINT_TO_POINTER(1)"/>
  </widget>
</child>
...

When I build, I still get the same error I mentioned before:

I don't know the type of GINT_TO_POINTER(1), so I can't connect
trajectoryTB's toggled
I don't know the type of GINT_TO_POINTER(1), so I can't connect
trajectoryTB's toggled
Internal error

Any other ideas? 

Tried to cast the pointer to g_object(GINT_TO_POINTER(1))?

John




-----Original Message-----
From: Hubert Sokolowski [  <mailto:h sokolowski wsisiz edu pl>
mailto:h sokolowski wsisiz edu pl]
Sent: Wednesday, March 23, 2005 12:22 PM
To: gtk-app-devel-list gnome org
Subject: Re: Using arguments in callbacks



Hi,

On Wed, 23 Mar 2005 11:59:39 -0500
Irwin Michael G DLVA <IrwinMG NSWC NAVY MIL> wrote:

Hello.  I am creating a GUI with Glade (V2.6.8).  I would like to have
several widgets call the same callback function, but with different
arguments passed to the function (e.g. the widget that called the
function).
It seems that the "Object" box under the "Signals" options is what I
would
need to use, but perhaps I am having trouble with the syntax of this
option.
Whatever I put in that box, it will give me an error when I build,
saying "I
don't know the type of [whatever I typed in there], so I can't connect
trajectoryTB's toggled"  (trajectoryTB is the widget name and the
signal is
toggled).  Can anyone help me out?
this Object must be a pointer that is available from the code where a
window is created, but you can also pass an int for
example
GINT_TO_POINTER(1)
and then get the int value using  GPOINTER_TO_INT

hs


_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
 <http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list>
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list






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