cogentcore / core

A free and open source framework for building powerful, fast, elegant 2D and 3D apps that run on macOS, Windows, Linux, iOS, Android, and the web with a single Go codebase, allowing you to Code Once, Run Everywhere.
http://cogentcore.org/core
BSD 3-Clause "New" or "Revised" License
1.76k stars 83 forks source link

Expose SetFilterer to set filterer function of FileButton's FilePicker #1312

Open bqback opened 1 week ago

bqback commented 1 week ago

Describe the feature

FileButton only allows setting filenames and extensions, which merely offers highlighting items that match the criteria. This offers no actual value beyond highlighting and (at least on Windows) fundamentally differs from how the "Extensions" field works in a regular (OS level) file picker.

FilePIcker supports providing a filter function that does what "Extensions" should do, but apparently it's not possible to bind to FilePIcker because it doesn't have a WidgetValue, and the internal filepicker of a FileButton isn't exposed anywhere at all.

Relevant code

No response

kkoreilly commented 1 week ago

Thank you for reporting this. We will expose the filter function on FileButton and make Extensions filter items instead of just highlighting them.