-
Notifications
You must be signed in to change notification settings - Fork 86
Description
Hi,
it would be great to be able to tell which filter in save dialog user selected.
Imagine an application where user wants to export an image in one of possible graphic formats.
dial := dialog.File().Title("Export as image")
dial.Filter("SVG (*.svg)", "svg")
dial.Filter("PNG (*.png)", "png")
dial.Filter("PDF (*.pdf)", "pdf")
filename, err := dialog.Save()User opens a dialog, selects png as type, and fill in just myimage as name, believing will create file myimage.png - which is common behavior and users are used to it - but it would not.
Problem is that value of variable filename is just "myimage".
It would be great if either:
-
there would be a way to detect which which filter is selected
fromnFilterIndexfield ofOPENFILENAMEstructure in win api
and fromdialog.GetFilter()in gtk lib on linux
it might by returned as additional value from.Save()method. -
or it could automatically append first extension from extensions of a selected filter to filename without extension
I'd be happy to help make an implementation for windows and linux platform.