Re: Problem with gsignal connect
- From: Jean Bréfort <jean brefort normalesup org>
- To: Naveen Kumar <naveen galieosoft com>
- Cc: gtk-list gnome org
- Subject: Re: Problem with gsignal connect
- Date: Mon, 13 Nov 2006 07:59:13 +0100
Le lundi 13 novembre 2006 �2:16 +0530, Naveen Kumar a �it :
> Hi all,
>
> I am using GTK+-2.2.0 to develop my application in that i am using 5
> entries.. and 2 spin buttons and i have 1 button. When i click the button i
> nned to access all the data of entries and spin buttons to some variables.
> Using g_signal_connect i am able to pass only one object but how can i pass
> all the objects (5 entries + 2 spin buttons ) of click on the button.
>
> I dont want my objects as globel. I was able to do if i declare as
> globel..
>
>
> Plese help me regard this,,
>
> Thanks in Advance
>
> Naveen
>
You have at least two solutions:
- group all your widgets in a structure and pass this strucyure as
user_data to g_signal_connect;
- add references to the other widgets to the button using
g_object_set_data, something as:
g_object_set_data (my_button, "spin1", my_spin_button1);
and then, in the signal handler, get back the spin button with:
my_spin_button1 = GTK_SPIN_BUTTON (g_object_get_data (button, "spin1"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]