[Glade-users] Libglade



No offense taken, but I'd like to point out that I did read the  
documentation, and it is rather vague. It says:

Sets iter to the currently selected node if selection is set to  
GTK_SELECTION_SINGLE or GTK_SELECTION_BROWSE. iter may be NULL if you  
just want to test if selection has any selected nodes. model is filled  
with the current model as a convenience. This function will not work  
if you use selection is GTK_SELECTION_MULTIPLE.

It hadn't occured to me that "model is filled with the current model  
as a convenience." meant it is not necessary

Cheers


Peyman

On 22 Jul 2009, at 14:06, Alexey Kurochkin wrote:

On Wed, 2009-07-22 at 13:18 +0100, Peyman wrote:
Thanks

I'm actually running into a lot of problems with GTK in C. I found it
much cleaner in python. Can you help me with

gboolean gtk_tree_selection_get_selected (GtkTreeSelection  
*selection,
GtkTreeModel **model, GtkTreeIter *iter);

what is **model? Why would I need a pointer, to a pointer, to my  
model?

It's just a convenience. In case you don't keep a pointer to the model
it will fill one for you, so you can access it right away without
calling gtk_tree_selection_get_tree_view() and
gtk_tree_view_get_model(). If you already have the pointer just pass
NULL there. You can also pass NULL for the iter when you only want to
check if something is selected and do not care what it is. All that is
pretty much clearly explained in the GTK docs. I do not want to be  
rude
or something, but sometimes the best approach is to RTFM:
http://library.gnome.org/devel/gtk/stable/GtkTreeSelection.html#gtk-tree-selection-get-selected


_______________________________________________
Glade-users maillist  -  Glade-users at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-users





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