Package: gtk

Function gtk-file-chooser-current-name

Lambda List

gtk-file-chooser-current-name (chooser)

Syntax

(gtk-file-chooser-current-name chooser) => name
(setf (gtk-file-chooser-current-name chooser) name)

Arguments

chooser -- a gtk-file-chooser widget
name -- a string with the filename to use, as a UTF-8 string

Details

Accessor of the current name of a file chooser widget.

The function gtk-file-chooser-current-name gets the current name in the file selector, as entered by the user in the text entry for "Name". The slot access functions (gtk-file-chooser-current-name) sets the current name.

This is meant to be used in save dialogs, to get the currently typed filename when the file itself does not exist yet. For example, an application that adds a custom extra widget to the file chooser for "file format" may want to change the extension of the typed filename based on the chosen format, say, from ".jpg" to ".png".

Note that the name passed in here is a UTF-8 string rather than a filename. This function is meant for such uses as a suggested name in a "Save As..." dialog. You can pass "Untitled.doc" or a similarly suitable suggestion for the name.

If you want to preselect a particular existing file, you should use the functions gtk-file-chooser-filename or gtk-file-chooser-uri instead. Please see the documentation for those functions for an example of using the function gtk-file-chooser-current-name as well.
 

See also

2021-2-5