1Gtk2::TreeIter(3) User Contributed Perl Documentation Gtk2::TreeIter(3)
2
3
4
6 Gtk2::TreeIter - wrapper for GtkTreeIter
7
9 Glib::Boxed
10 +----Gtk2::TreeIter
11
13 package MyCustomListStore;
14
15 use Glib::Object::Subclass
16 Glib::Object::,
17 interfaces => [ Gtk2::TreeModel:: ],
18 ;
19
20 ...
21
22 sub set {
23 my $list = shift;
24 my $iter = shift; # a Gtk2::TreeIter
25
26 # this method needs access to the internal representation
27 # of the iter, as the model implementation sees it:
28 my $arrayref = $iter->to_arrayref ($list->{stamp});
29 ...
30 }
31
33 The methods described here are only of use in custom Gtk2::TreeModel
34 implementations; they are not safe to be used on generic iters or in
35 application code. See "CREATING A CUSTOM TREE MODEL" in
36 Gtk2::TreeModel for more information.
37
39 treeiter = Gtk2::TreeIter->new_from_arrayref ($sv_iter)
40 • $sv_iter (scalar)
41
42 Create a new Gtk2::TreeIter from the "internal" array reference
43 representation used by custom Gtk2::TreeModel implementations. This is
44 the complement to Gtk2::TreeIter::to_arrayref(), and is used when you
45 need to create and return a new iter from a method that is not one of
46 the Gtk2::TreeModelIface interface vfuncs. See "CREATING A CUSTOM TREE
47 MODEL" in Gtk2::TreeModel for more information.
48
49 $iter->set ($from)
50 • $from (scalar)
51
52 Set the contents of $iter. $from can be either another Gtk2::TreeIter
53 or an "internal" arrayref form as above.
54
55 Often you create a new iter instead of modifying an existing one, but
56 "set" lets you to implement things in the style of the "remove" method
57 of Gtk2::ListStore and Gtk2::TreeStore.
58
59 A set can also explicitly invalidate an iter by zapping its stamp, so
60 nobody can accidentally use it again.
61
62 $iter->set ([0,0,undef,undef]);
63
64 scalar = $iter->to_arrayref ($stamp)
65 • $stamp (integer)
66
67 Convert a boxed Gtk2::TreeIter reference into the "internal" array
68 reference representation used by custom Gtk2::TreeModel
69 implementations. This is necessary when you need to get to the data
70 inside your iters in methods which are not the vfuncs of the
71 Gtk2::TreeModelIface interface. The stamp must match; this protects
72 the binding code from potential memory faults when attempting to
73 convert an iter that doesn't actually belong to your model. See
74 "CREATING A CUSTOM TREE MODEL" in Gtk2::TreeModel for more information.
75
77 Gtk2, Glib::Boxed, Gtk2::TreeModel
78
80 Copyright (C) 2003-2011 by the gtk2-perl team.
81
82 This software is licensed under the LGPL. See Gtk2 for a full notice.
83
84
85
86perl v5.32.1 2021-01-27 Gtk2::TreeIter(3)