Closed SudoDios closed 3 months ago
FileDialog.openMultipleFinish
doesn't specify the item type of the ListModel, so it defaults to plain GObjects. I'll log an issue in Gtk to add the missing annotation.
You can work around it in the meantime:
ListModel list = dialog.openMultipleFinish(result);
List<File> files = new ArrayList<>();
for (int i = 0; i < list.getNItems(); i++)
files.add(new File.FileImpl(list.getItem(i).handle()));
thanks bro. Okay
Correction; it's not a missing annotation. ListModels just always return plain GObjects. I'll try to find a better solution than the workaround above though.
Yes that's right.
ListModels just always return plain GObjects.
In the next release it will be possible to do var file = (File) listmodel.getItem(i)
.
How great 👍
Can you write example of FileDialog with openMultiple ? (how to get file from ListModel of GObjects ?)