fyne-widgets/examples/profilebtn/main.go

32 lines
644 B
Go

package main
import (
"bytes"
"fmt"
"image"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"git.martyn.berlin/martyn/fyne-widgets/pkg/profilebtn"
)
func main() {
a := app.New()
w := a.NewWindow("ProfileBtn")
b := profilebtn.NewProfileBtn()
i, s, err := image.Decode(bytes.NewReader(resourceProfilepicdoesnotexistJpg.StaticContent))
fmt.Println(s)
if err != nil {
fmt.Println(err)
panic(err)
}
fmt.Println(i.Bounds())
b.SetProfileImage(i)
b.OutlineWidth = 5
w.SetContent(container.NewBorder(nil, nil, nil, nil, b))
w.Resize(fyne.NewSize(640, 480))
w.ShowAndRun()
}