Re: Signal Handling problems with own data



On Fri, 18 Aug 2006 07:03:41 -0700 (PDT)
NicolasA <kinolis2001 yahoo gr> wrote:

In my case I want to pass two widgets(the two text entries)so that
when my function is called, to access the two text entries, grab their
contents and validate the username and password with the server. How
can I pass both the text entry widgets to the function that is called
after the emission of the button click signal?

You can make a struct with the pointers to two widgets inside, 

struct {
  GetWidget *name, *pass;
} myTwoWidgets;

or an array of two pointers

GtkWidget *myTwoWidgets[2]

and pass a pointer to the struct/array as data. In both cases you will
have to typecast the gpointer in the handler to the corresponding type.

If you're using Glade, you can also pass the reference to the parent
window, and do lookup_widget (parent, "xxxx") for each widget inside the
handler.

John



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