Gtk2::FileFilter(3)
π Gtk2::FileFilter β the manual, but make it cute
okay so bestie, this is the user-contributed Perl documentation page for Gtk2::FileFilter β a lil wrapper for GtkFileFilter, aka the thing that decides which files get to show up in your file chooser and which ones get politely ghosted. π It ships in the Gtk2 Perl docs, so grab a strawberry π and let's go.
β¨ NAME β¨
Gtk2::FileFilter β wrapper for GtkFileFilter
it's giving "gatekeeper but make it a class" π
π HIERARCHY π
Look at this family tree, she comes from good stock:
Glib::Object
+----Glib::InitiallyUnowned
+----Gtk2::Object
+----Gtk2::FileFilter
four generations deep and every single one of them ate π
π METHODS π
filefilter = Gtk2::FileFilter->new
the main character constructor. Makes you a brand new Gtk2::FileFilter. β¨
$filter->add_custom ($needed, $func, $data=undef)
Add your own custom filter logic, iykyk. The args:
$neededβ aGtk2::FileFilterFlags(tell it what info your callback needs)$funcβ a scalar (your function, bestie)$dataβ a scalar, and it defaults toundefif you don't pass one
$filter->add_mime_type ($mime_type)
$mime_typeβ a string
drop a mime type in and let it cook π§
$filter->add_pattern ($pattern)
$patternβ a string
glob patterns, we love to see it π
$filter->add_pixbuf_formats
Since: gtk+ 2.6 β
not me adding every pixbuf format at once, no cap
boolean = $filter->filter ($filter_info)
$filter_infoβ a scalar
this one returns a boolean, so likeβ¦ true or false, slay or nay π
string = $filter->get_name
grab the filter's name, get that string back π
$filter->set_name ($name)
$nameβ a string
name your filter something iconic π
filefilterflags = $filter->get_needed
returns a filefilterflags β the flags this filter asked for πΈ
π¦ ENUMS AND FLAGS π¦
flags Gtk2::FileFilterFlags
The vibe check menu, pick your faves:
'filename'/'GTK_FILE_FILTER_FILENAME''uri'/'GTK_FILE_FILTER_URI''display-name'/'GTK_FILE_FILTER_DISPLAY_NAME''mime-type'/'GTK_FILE_FILTER_MIME_TYPE'
yes the short name and the long GTK_ name both work, we stay flexible π
π SEE ALSO π
Go read these too, fr fr:
Gtk2Glib::ObjectGlib::InitiallyUnownedGtk2::Object
π COPYRIGHT π
Copyright (C) 2003-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See Gtk2 for a full notice.
do NOT lose this part, bestie β license details are not optional, periodt. π
and that's the whole page!! this was generated with perl v5.42.0 on 2025-07-25 β bye babes, go filter some files πβ¨ππ¦πΈπ
π«Ά
π¦ where this page comes from
- fedora 43: perl-Gtk2 1.24993-23.fc43 Β· LicenseRef-Callaway-LGPLv2+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms