Checking for UI hints
As Fyne is built using Material Design principles, it is possible to make use of their recommendations for good and bad ways to use certain components and how you should and shouldn't combine elements for a great UX.
Built into the Fyne toolkit is the concept of hints. These are suggestions that widgets and other components can make about how an app could make changes to offer an improved user interface.
We will start exploring what these hints can offer by creating a simple example tab container application. This code snippet will load two tabs into a tab container (the makeTabs()
function). We then include a main()
function that will load a new app, create a window, and set the tabs to be its content. The function then runs our app in the usual way as follows:
package main import ( "fyne.io/fyne/v2/app" "fyne.io/fyne/v2/container" "fyne.io/fyne/v2/theme...