RE: question



Title: question
Hello,
One of the ways u can do this is
by g_object_set_data on window for all widgets contained in window
 
smthg like
g_object_set_data(window, "name_entry',  name_widget); 
g_object_set_data(window, "addrs_entry',  addrs_widget); 
 
and pass the window as your user data.
then in ur callback,  do g_object_get_data ....
 
Hope this sol helps u..
 
~Ratna


From: gtk-list-bounces gnome org on behalf of Moises
Sent: Wed 4/2/2008 1:53 AM
To: Diego Jacobi; gtk-list gnome org
Subject: question


> The way that you order your data is the kind of
> programmer that you are.
>
> gboolean btnAcept_button_press_event (GtkWidget
> *widget, GdkEventButton
> *event, gpointer user_data)
>
> It seems like you dont know what is the first
> argument.
> It is the widget how calls the eventm so you dont
> need a global variable to
> get its value. You just need the widget pointer and
> know what kind of widget
> it is, that is up to you.
>


The first argument is pointer of btnAcept, but I do
not the pointer of this, because the event
"press_button" give me it.

I need pointer of   gentName, gentAdres, gentTel,
gentEmail, gentCol, for I want to get data from these
widget, for that reason I have as global variables.
for I can get their data into the function
“btnAcept_button_press_event”.

But if I have a windows with 9 GtkEntry, 8
GtkCheckButton, 5 GtkComboBox. I am not going to have
22 global variables for these widgets.

Again

But, as I mentioned before in visual basic can do
this.

Name=Me.txtName.tex()

But the problem is that I am use C.

Then as do I same with gtk and C?



      ____________________________________________________________________________________
ˇCapacidad ilimitada de almacenamiento en tu correo!
No te preocupes más por el espacio de tu cuenta con Correo Yahoo!:                     
http://correo.yahoo.com.mx/
_______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list



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