Fyne get listableURI

75 Views Asked by At

Is there a way to get a listableURI anymore? enter image description here

fdialog := widget.NewButton("", func() {
                locationURI := storage.NewFileURI("myfilepath")
                listableURI, err := storage.ListerForURI(locationURI)
        if err != nil {}
        fd := dialog.NewFileOpen(func(uri fyne.URIReadCloser, err error) {
            if uri != nil {
                fmt.Println("Selected File : ", uri.URI())
            }
        }, w2)
        fd.SetLocation(listableURI)
        fd.Show()
    })

I get an error message over listableURI when passed into the SetLocation function as:

cannot use listableURI (variable of type "fyne.io/fyne".ListableURI) as 
"fyne.io/fyne/v2".ListableURI value in argument to fd.SetLocation: 
"fyne.io/fyne".ListableURI does not implement "fyne.io/fyne/v2".
ListableURI (missing method Authority)compilerInvalidIfaceAssign

I've checked the methods in the storage and dialog packages and I can only find the ListerForURI method that returns a listableURI, but it seems to be missing a method call Authority. Any ideas? Is it possible to add a method with that name into the current listableURI, and what would that look like?

0

There are 0 best solutions below