Calling function w/ multiple parameters



Continuing my previous message, I opted to use a pointer to a
structure to pass all the parameters to my function through
the use of the fourth argument of "gtk_signal_connect()",
which is actually expecting a "gpointer".  Well, it doesn't
work.  No surprise here.  Is there a Macro or other method
in order to be able to send this pointer to the function?

Thanks, ajam.


Michael J. Hammel wrote:

> In a previous message, ajam says:
> > How can I use "gtk_signal_connect()" to call
> > a function that contains three or more parameters,
> > which are not necessarily related to the object
> > (widget) included in the 'signal handler'
>
> Theres really only one way to do this.  The signal handler has a defined
> set of parameters, so you call a "dummy" callback that is used to call your
> function (the one with multiple parameters).  There might be trickier ways
> to do this, but this is the most straightforward.  If you need to pass data
> to your function then use the client_data argument of the
> gtk_signal_connect() call.
>
> --
> Michael J. Hammel           |Webster's definition of Win95: 32bit extensions and
> The Graphics Muse           |graphical shell for a 16bit patch to an 8bit OS
> mjhammel@graphics-muse.org  |originally coded for a 4bit cpu, written by a 2 bit
> http://www.graphics-muse.org  company, that can't stand 1 bit of competition.
>
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null





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