Gtk2::T...elFilter(3)

πŸ“¦
version 1.24993 Β· 2 versions
, in fedora 43

πŸ’– Gtk2::TreeModelFilter β€” the wrapper for GtkTreeModelFilter πŸ’–

okay so bestie, this is the perl binding for GtkTreeModelFilter, from the Gtk2 module β€” it's the little icon that sits on top of another model and goes "mmm, no, not you" to some rows and "yes queen, come through" to others πŸ‘‘


🌈 HIERARCHY

Glib::Object
+----Gtk2::TreeModelFilter

it's giving nepo baby β€” Glib::Object is literally its parent πŸ’…


πŸ¦‹ INTERFACES

  • Gtk2::TreeModel
  • Gtk2::TreeDragSource

so it's a model and it can be dragged from. versatile. main character energy fr fr ✨


πŸŽ€ METHODS

treemodelfilter = Gtk2::TreeModelFilter->new ($child_model, $root=undef)

builds you a fresh filter πŸ’– and here's what you hand it:

  • $child_model (Gtk2::TreeModel)
  • $root (Gtk2::TreePath or undef)

$filter->clear_cache

wipes the cache. that's it, that's the whole vibe 🧹


treeiter = $filter->convert_child_iter_to_iter ($child_iter)

  • $child_iter (Gtk2::TreeIter)

treepath or undef = $filter->convert_child_path_to_path ($child_path)

  • $child_path (Gtk2::TreePath)

note the or undef bestie β€” sometimes there's just nothing to give you 😭


treeiter = $filter->convert_iter_to_child_iter ($filter_iter)

  • $filter_iter (Gtk2::TreeIter)

treepath or undef = $path->convert_path_to_child_path ($filter_path)

  • $filter_path (Gtk2::TreePath)

(yeah, it's called as $path->... up in here β€” that's exactly how it's written, don't come for me πŸ™ˆ)


treemodel = $filter->get_model

returns the model. no args. no drama. slay 🫢


$filter->set_modify_func ($types, $func=undef, $data=undef)

  • $types (scalar) β€” type name string for one column, or an arrayref of type names for multiple columns
  • $func (scalar)
  • $data (scalar)

and func gets called like this, okay:

sub myfunc {
  my ($filter, $iter, $column_num, $data) = @_;
  ...
}

and it should return the value from the filtered model at that iter row and column number. that's the assignment, bestie ✍️


$filter->refilter

re-runs the filter. like refreshing your for you page but for rows πŸ”₯


$filter->set_visible_column ($column)

  • $column (integer)

$filter->set_visible_func ($func, $data=undef)

  • $func (scalar)
  • $data (scalar)

✨ PROPERTIES ✨

  • 'child-model' (Gtk2::TreeModel : default undef : readable / writable / construct-only / private / static-nick / static-blurb) β€” The model for the filtermodel to filter
  • 'virtual-root' (Gtk2::TreePath : default undef : readable / writable / construct-only / private / static-nick / static-blurb) β€” The virtual root (relative to the child model) for this filtermodel
heads up: both of these are construct-only and private, so set them when you build the thing, not after. the door locks behind you πŸšͺπŸ”’

πŸ‘€ SEE ALSO

Gtk2, Glib::Object


Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL. See Gtk2 for a full notice.


and that's the whole page bestie πŸ’œ this was user contributed perl documentation, Gtk2::T...elFilter(3), and honestly? the perl version stamped on it is v5.42.0 with a date of 2025-07-25. iconic. no cap. go forth and filter πŸ¦‹βœ¨

πŸ“¦ where this page comes from