Gtk2::F...erButton(3)

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

πŸ’… 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::AtkImplementorIface
  • Gtk2::Buildable
  • Gtk2::Orientable
  • Gtk2::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 (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