Gtk2::F...erButton(3)
π NAME π
okay bestie, gather round, because today we're talking about Gtk2::FileChooserButton β it's the Perl wrapper for GtkFileChooserButton, and yes, it's exactly as iconic as it sounds. this is a page from the User Contributed Perl Documentation, so you know it's the real deal. β¨
πΈ HIERARCHY πΈ
the family tree, and it is giving lineage:
Glib::Object
+----Glib::InitiallyUnowned
+----Gtk2::Object
+----Gtk2::Widget
+----Gtk2::Container
+----Gtk2::Box
+----Gtk2::HBox
+----Gtk2::FileChooserButton
lowkey a whole ancestry reveal. it goes all the way down from Glib::Object and lands right here. π«Ά
π¦ INTERFACES π¦
this button didn't come alone, she brought friends:
Glib::Object::_Unregistered::AtkImplementorIfaceGtk2::BuildableGtk2::OrientableGtk2::FileChooser
main character with a whole entourage, periodt.
β¨ METHODS β¨
π constructors
widget = Gtk2::FileChooserButton->new ($title, $action)$title(string) β the title, bestie. it's a string.$action(Gtk2::FileChooserAction) β what kind of chooser vibe we're going for.
widget = Gtk2::FileChooserButton->new_with_backend ($title, $action, $backend)$title(string)$action(Gtk2::FileChooserAction)$backend(string) β yeah, you get to pick the backend. fancy.
widget = Gtk2::FileChooserButton->new_with_dialog ($dialog)$dialog(Gtk2::Widget) β bring your own dialog, we'll wrap it. π
π focus-on-click shenanigans
boolean = $button->get_focus_on_click- Since: gtk+ 2.10
$button->set_focus_on_click ($focus_on_click)$focus_on_click(boolean)- Since: gtk+ 2.10
π title business
string = $button->get_title$button->set_title ($title)$title(string)
π§ width chars, we love a sizing moment
integer = $button->get_width_chars$button->set_width_chars ($n_chars)$n_chars(integer)
π PROPERTIES π
'dialog'(Gtk2::FileChooser : default undef : writable / construct-only / private / static-nick / static-blurb)- The file chooser dialog to use.
'focus-on-click'(boolean : default true : readable / writable / private / static-nick / static-blurb)- Whether the button grabs focus when it is clicked with the mouse
'title'(string : default "Select a File" : readable / writable / private / static-nick / static-blurb)- The title of the file chooser dialog.
'width-chars'(integer : default -1 : readable / writable / private / static-nick / static-blurb)- The desired width of the button widget, in characters.
π₯ SIGNALS π₯
file-set(Gtk2::FileChooserButton) β she's telling you the file got set. pay attention. π£
π ENUMS AND FLAGS π
enum Gtk2::FileChooserAction
'open'/GTK_FILE_CHOOSER_ACTION_OPEN'save'/GTK_FILE_CHOOSER_ACTION_SAVE'select-folder'/GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER'create-folder'/GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER
four whole options, all slaying in their own lane. pick your fighter. β
π SEE ALSO π
go read these next, bestie, the whole squad:
Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Container, Gtk2::Box, Gtk2::HBox
π COPYRIGHT π
Copyright (C) 2003-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See Gtk2 for a full notice.
ngl, respect the license. it's LGPL, so go read Gtk2 for the full notice before you do anything spicy. π
that's the whole page, bestie β documented by perl v5.42.0 on 2025-07-25, and it's been a whole journey. go build something cute with it. bye mwah π ππ¦
π¦ 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