Re: I'd like to ask about menu item callback



Dear Phong,

On Mon, 2005-11-21 at 13:55 +0700, nguyen phong wrote:
How can I pass 2 parameters to the callback function of a menu item?
[...]

You might have noticed that all the callback takes is a pointer.  Well,
that could be a pointer to anything.  Say, a pointer to a struct, which
contains as many pieces of data as you'd like.

In other words, there is no sense in allowing callbacks to take two
pointers for data, since one can just pass a pointer to any home-grown
data structure containing all the information one needs.

---------------------------------

and
how can I pass a widget parameter and a data parameter when I click on the 
menu_item
For example:
In callback function:
void call_back_test(GtkWidget *widget,gpointer user_data)
[...]

Don't really understand this question.  Can you be a little clearer?

-Andrew



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