Accordion items – Fyne GUI Golang tutorial 40

Accordion items – – Fyne GUI Golang tutorial 40

 

 

<div>
<div>package main</div>
<div>// import fyne</div>
<div>import (</div>
<div>    "fyne.io/fyne/v2"</div>
<div>    "fyne.io/fyne/v2/app"</div>
<div>    "fyne.io/fyne/v2/widget"</div>
<div>)</div>
<div>func main() {</div>
<div>    // New app</div>
<div>    a := app.New()</div>
<div>    // New title</div>
<div>    w := a.NewWindow("Accordian - fyne ")</div>
<div>    // resize windows size</div>
<div>    w.Resize(fyne.NewSize(400, 400))</div>
<div>    // Let create items for accoridan</div>
<div>    // first argument is title, 2nd is description/details</div>
<div>    item1 := widget.NewAccordionItem("A",</div>
<div>        widget.NewLabel("A for Apple"))</div>
<div>    item2 := widget.NewAccordionItem("B",</div>
<div>        widget.NewLabel("B for Ball"))</div>
<div>    item3 := widget.NewAccordionItem("C",</div>
<div>        widget.NewLabel("C for Cat"))</div>
<div>    ac := widget.NewAccordion(item1, item2, item3)</div>
<div>    w.SetContent(ac)</div>
<div>    w.ShowAndRun()</div>
<div>}</div>
</div>
Download Code

Fyne Golang GUI Course

 

Tony BB
 

TonyBB is a Coach , marketer, hypnotist and a founder of RSKVF Production who specializes in providing simple, affordable, and easy to use solutions for Life.

Click Here to Leave a Comment Below 0 comments

Leave a Reply: