Re: Argument passing / GTKTextView



-

you can either use gtk_object_set_data() on the widget, to set associate
a key string with a gpointer data element:

gtk_object_set_data(GTK_OBJECT(widget),"struct",structure);

then in the callback:

structure = gtk_object_get_data(GTK_OBJECT(widget),"struct");


or pass a structure containing everything (gints,other structs, etc)


From: Raymond Wan
Subject: Argument passing / GTKTextView
Date: Wed, 13 Jun 2001 13:01:54 +1000 (EST)


> 
>  Hi all,
>  
>  	My GTK+ program is getting fairly large and until now, I've had
>  one big global variable structure that has all the information I need.  I
>  was wondering if there is an alternative to this.
>  
>  	The program I'm having seems to be in the call back functions,
>  which I don't seem to entirely understand.  For example, in a call back
>  function such as this:
>  
>  void closeChildWindow (GtkWidget *widget, gpointer data)
>  
>  	I've been passing ints from my program using GPOINTER_TO_INT and
>  GINT_TO_POINTER.  But, can I pass anything else, such as a C pointer to a
>  structure or can I pass more than one argument?  If so, how would I do
>  this? 
>  
>  	Also, a separate question...does anyone know of a GTKTextView
>  example (GTK 1.3) that is slightly more involved than the HTML GTK
>  Reference under the section Text Widget Overview?  Possibly using tags,
>  marks, and iterators?
>  
>  	Thank you!
>  
>  Ray
>  
>  
>  
>  _______________________________________________
>  gtk-list mailing list
>  gtk-list gnome org
>  http://mail.gnome.org/mailman/listinfo/gtk-list
>  
>  

-- 
Charlie Schmidt - <ishamael techcare com>





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