gtk2-perl / Gtk2->equals



Hi,

FYI I've added the Gtk2->equals function, it's useful to know if
two gtk2-perl wrapped object are actually the same gtk objects (C
pointer wise - e.g. is it the same memory pointer? - e.g. what
you would be doing in C with the == operator on two pointer
variables). In gtk-perl for gtk-1.2, there was a complex
mechanism allowing them to have a more elegant solution that
ours, e.g. the perl object was the same than the other one, if
the gtk object was the same; since we don't have such a mechanism
in gtk2-perl, we needed another way to know if two perl variables
are actually the same underlying gtk object.

There is a testcase for that in misc-examples/treeview.pl at
lines 97 and 98: in the treeview, on which column did the user
click? - since gtk_tree_view_get_path_at_pos returns a pointer on
the column in which the click occurred, we then compare with
Gtk2->equals with the gtk2-perl objects we had for the columns.

-- 
Guillaume Cottenceau - http://people.mandrakesoft.com/~gc/



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