Gtk2::E...iewFile(3)

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

✨ NAME ✨

Gtk2::Ex::Dialogs::ChoosePreviewFile β€” bestie, it's a whole file selection dialog πŸ’– (and yeah, the manpage name got chopped to Gtk2::E...iewFile but we know the truth, ok?)


🌸 SYNOPSIS 🌸

use Gtk2::Ex::Dialogs::ChoosePreviewFile ( destroy_with_parent => TRUE,
                                    modal => TRUE );

# do some stuff like creating your app's main $window then,
# to ensure that all messages use the right parent, set it:
$Gtk2::Ex::Dialogs::ChoosePreviewFile::parent_window = $window;

# now popup a new dialog for opening a file
my $file = ask_to_open
            Gtk2::Ex::Dialogs::ChoosePreviewFile ( "/path/to/something" );

# ok, now we need to save (as...) a file
my $save = ask_to_save
            Gtk2::Ex::Dialogs::ChoosePreviewFile ( "/path/to/something" );

πŸ¦‹ DESCRIPTION πŸ¦‹

So basically this module hands you a simple file chooser api that wraps Gtk2::FileChooser objectively. The whole goal? Giving you a simple ways to prompt a user to open or save a file. That's it, that's the vibe. No cap. πŸŽ€


πŸ‘‘ OPTIONS πŸ‘‘

Every public method (and literally the entire class, no exceptions bestie) supports these options:

  • title => STRING β€” the text string that becomes the title of the dialog window. Defaults to either "Open" or "Save" depending on the action context. She picks her own name based on what she's doing πŸ’…
  • path => STRING β€” the path to a file or directory to initialize the dialog with. Defaults to the current working directory. Starting point, periodt.
  • parent_window => Gtk2::Window β€” a reference to the main application window. Your main character window 🫢
  • destroy_with_parent => BOOL β€” when the parent_window gets destroyed, what do we do? Defaults to FALSE.
  • modal => BOOL β€” does this dialog make the parent_window freeze while the dialog exists? Defaults to FALSE. Lowkey powerful.
  • must_exist => BOOL β€” the end-user must supply a path to an existing file or directory. If they hand you a non-existant path, the dialog will be respawned until an existing file is chosen. Defaults to FALSE. She will NOT let it go 😭

πŸ’œ PUBLIC METHODS πŸ’œ

  • OBJECT = new ( OPTIONS | PATH ) β€” creates a Gtk2::FileChooserDialog with the options you gave and shows it to the end-user. Once they've selected a file, it returns only the path to the file and cleans up after itself. Special case alert 🚨: if you pass it just one argument, all options go to defaults and that one argument gets used as the path argument.
  • RESPONSE = ask_to_open ( OPTIONS | PATH ) β€” supports all the same arguments as new(). This makes a fresh Gtk2::Ex::Dialogs::ChoosePreviewFile with some specific defaults, and returns the user's response. If you give it only one argument, that argument gets used as the path option.
  • RESPONSE = ask_to_save ( OPTIONS | PATH ) β€” supports all the same arguments as new(). This makes a fresh Gtk2::Ex::Dialogs::ChoosePreviewFile with some specific defaults, and returns the user's response. If you give it only one argument, that argument gets used as the path option. (Yes bestie she and ask_to_open are twins, matching energy ✨)

πŸ”₯ SEE ALSO πŸ”₯

  • Gtk2::FileChooser
  • Gtk2::FileChooserDialog
  • Gtk2::Ex::Dialogs
  • Gtk2::Ex::Dialogs::ChooseDirectory
  • Gtk2::Ex::Dialogs::ChooseFile
  • Gtk2::Ex::Dialogs::ErrorMsg
  • Gtk2::Ex::Dialogs::Message
  • Gtk2::Ex::Dialogs::Question

πŸ’€ BUGS πŸ’€

Please report any bugs to the mailing list. Found something cursed? Tell the list, not me πŸ™ˆ


πŸ“ MAILING LIST πŸ“

http://opendoorsoftware.com/lists/gtk2-ex-list
gtk2-ex-list@opendoorsoftware.com

⭐ AUTHORS ⭐

Kevin C. Krinke, <kckrinke@opendoorsoftware.com>
James Greenhalgh, <jgreenhalgh@opendoorsoftware.com>

Gtk2::Ex::Dialogs::ChoosePreviewFile - Provides a file selection dialog.
Copyright (C) 2005 Open Door Software Inc. <ods@opendoorsoftware.com>

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

fr fr, read the license, it's giving "legal but make it adorable" and she means every word πŸ’–

okay that's the whole page bestie, slay πŸ’… β€” this was Perl v5.42.0, dated 2025-07-25, user contributed Perl documentation, and it ate. periodt. πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from