Re: [gtk-list] more than one arg to signal/timeout handlers





> How would one effectively handle passing more than one argument to a
> signal or timeout handler?  Forgive me if this has been answered
> already, and I bet you can tell that I'm quite new to GTK.
> 
> tile
> tile@primenet.com

Hello,

Try creating a struct for the information, and pass a pointer to that
struct to the signal handler.

eg

struct dialogdata
{
  Widget *dialog_wnd;
  Widget *ok_button;
  Widget *cancel_button;
  Widget *text1;
  Widget *text2;
};

struct dialogdata *data;

data = g_malloc( sizeof(dialogdata) );

data->dialog_wnd=...;

gtk_signal_connect(........., data);


That's what I'm doing at least. :)

Dave
lndshark@megsinet.net



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