February 2019
Intermediate to advanced
450 pages
11h 59m
English
As the Fyne list widgets do not support icon and text combinations, we will need to construct one from basic components. Within the file group, we update each item to call a new function, makeRow(), that will be defined later on. We pass the filename to this function so that it can load the image and display a suitable caption:
fileList := widget.NewGroup("directory", makeRow("shiny-hall.jpg"), makeRow("shiny-hall.jpg"), makeRow("shiny-hall.jpg"))
The new makeRow() function will return a horizontal box widget containing the image preview and caption text. The preview image is loaded using canvas.NewImageFromFile() and a suitable size is set using SetMinSize(). To be consistent in terms of sizing, theme.IconInlineSize() is used ...
Read now
Unlock full access