February 2019
Intermediate to advanced
450 pages
11h 59m
English
To complete the navigation bar, we need to also display the filename in the middle of the bar. As you may have noticed, there is no toolbar widget that allows the showing of text, but we can create our own. Every item in a toolbar implements the widget.ToolbarItem interface, so we can create a new type that follows this pattern. By implementing ToolbarObject() (the only function this interface requires), we can return the appropriate label to display:
type toolbarLabel struct {}func (t *toolbarLabel) ToolbarObject() fyne.CanvasObject { return widget.NewLabel("filename")}
While we are updating the navigation bar, we should create placeholder functions that will handle the button presses for "previous" (left arrow) and "next" (right ...
Read now
Unlock full access