Package: gtk
Class gtk:file-filter
Superclassesgobject:object, common-lisp:standard-object, common-lisp:t Documented Subclasses
None
Direct Slots
None
Details The gtk:file-filter object can be used to restrict the files being shown in a gtk:file-chooser widget.
Files can be filtered based on their name with the gtk:file-filter-add-pattern function, on their mime type with the gtk:file-filter-add-mime-type function, or by a custom filter function with the gtk:file-filter-add-custom function. Filtering by MIME types handles aliasing and subclassing of mime types. E.g. a filter for text/plain also matches a file with MIME type application/rtf, since application/rtf is a subclass of text/plain. Note that the gtk:file-filter object allows wildcards for the subtype of a MIME type, so you can e.g. filter for image/*. Normally, filters are used by adding them to a gtk:file-chooser widget, see the gtk:file-chooser-add-filter function, but it is also possible to manually use a filter on a file with the gtk:file-filter-filter function. GtkFileFilter as GtkBuildableExample: A UI definition fragment specifying gtk:file-filter rules <object class="GtkFileFilter"> <mime-types> <mime-type>text/plain</mime-type> <mime-type>image/*</mime-type> </mime-types> <patterns> <pattern>*.txt</pattern> <pattern>*.png</pattern> </patterns> </object> | Returned byInherited Slot Access FunctionsSee also |
2023-6-11