1Gtk2::TreeIter(3)     User Contributed Perl Documentation    Gtk2::TreeIter(3)
2
3
4

NAME

6       Gtk2::TreeIter
7

HIERARCHY

9         Glib::Boxed
10         +----Gtk2::TreeIter
11

SYNOPSIS

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

DESCRIPTION

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

METHODS

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.
44           This is the complement to Gtk2::TreeIter::to_arrayref(), and is
45           used when you need to create and return a new iter from a method
46           that is not one of the Gtk2::TreeModelIface interface vfuncs.  See
47           "CREATING A CUSTOM TREE MODEL" in Gtk2::TreeModel for more
48           information.
49
50   $iter->set ($from)
51           ·   $from (scalar)
52
53           Set the contents of $iter.  $from can be either another
54           Gtk2::TreeIter or an "internal" arrayref form as above.
55
56           Often you create a new iter instead of modifying an existing one,
57           but "set" lets you to implement things in the style of the "remove"
58           method of Gtk2::ListStore and Gtk2::TreeStore.
59
60           A set can also explicitly invalidate an iter by zapping its stamp,
61           so nobody can accidentally use it again.
62
63               $iter->set ([0,0,undef,undef]);
64
65   scalar = $iter->to_arrayref ($stamp)
66           ·   $stamp (integer)
67
68           Convert a boxed Gtk2::TreeIter reference into the "internal" array
69           reference representation used by custom Gtk2::TreeModel
70           implementations.  This is necessary when you need to get to the
71           data inside your iters in methods which are not the vfuncs of the
72           Gtk2::TreeModelIface interface.  The stamp must match; this
73           protects the binding code from potential memory faults when
74           attempting to convert an iter that doesn't actually belong to your
75           model.  See "CREATING A CUSTOM TREE MODEL" in Gtk2::TreeModel for
76           more information.
77

SEE ALSO

79       Gtk2, Glib::Boxed, Gtk2::TreeModel
80
82       Copyright (C) 2003-2008 by the gtk2-perl team.
83
84       This software is licensed under the LGPL.  See Gtk2 for a full notice.
85
86
87
88perl v5.12.0                      2010-05-02                 Gtk2::TreeIter(3)
Impressum