cogentcore / core

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

How to specify ext extension in FuncButton for method taking gi.Filename arg? #860

Closed rcoreilly closed 5 months ago

rcoreilly commented 5 months ago

Describe the feature

need to be able to specify the file extension that a given gi.Filename is looking for, as an arg to a method, where FuncButton will pull up the FileView. The FileValue looks for an "ext" tag with the extension(s).

Relevant code

No response

kkoreilly commented 5 months ago

Just do this: fb.Args[0].SetTag("ext", ".json") (or any other argument index or extension). You can see this done already throughout the codebase, especially in Cogent Code.

rcoreilly commented 5 months ago

thanks -- need docs for this!

kkoreilly commented 5 months ago

That will happen in the context of #491.