Re: referencing widgets
- From: Sven Neumann <sven gimp org>
- To: John Cupitt <john cupitt ng-london org uk>
- Cc: HaB balicious <vhab hotmail com>, gtk-list gnome org
- Subject: Re: referencing widgets
- Date: 09 Feb 2001 20:21:33 +0100
John Cupitt <john cupitt ng-london org uk> writes:
> HaB balicious wrote:
> > My question is this. In the function I call via the OK buttons "clicked"
> > event, is there a way to reference each of the entry widgets separately?
> > IOW, since they were all created with the same declared var, 'entry', is
> > there a way to tell which is which once I am in another func? Or do I have
> > to create them all separately, passing each one's variable out to the verify
> > func? Make them global?
>
> Hiya, the usual way to do this is to make a struct with a member for
> each of your widgets. g_new() one of your structs when you build the
> dialog, set the members as you build the widgets, pass the address of
> the struct to the callback, and free the struct on destroy.
Another possibility is to add the widget pointers to the OK button
using gtk_object_set_data (object, "some_descriptive_name, pointer)
and retrieving them in the callback using gtk_object_get_data().
Salut, Sven
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]