update
This commit is contained in:
69
scripts/alert/alert.go
Normal file
69
scripts/alert/alert.go
Normal file
@@ -0,0 +1,69 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fyne.io/fyne/v2/app"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
)
|
||||
|
||||
func main() {
|
||||
myApp := app.New()
|
||||
myWindow := myApp.NewWindow("Label Widget")
|
||||
|
||||
content := widget.NewLabel("text")
|
||||
|
||||
myWindow.SetContent(content)
|
||||
myWindow.SetFullScreen(true)
|
||||
myWindow.ShowAndRun()
|
||||
}
|
||||
|
||||
//package main
|
||||
//
|
||||
//import (
|
||||
// "image/color"
|
||||
// "os"
|
||||
// "strconv"
|
||||
// "time"
|
||||
//
|
||||
// "fyne.io/fyne/v2"
|
||||
// "fyne.io/fyne/v2/app"
|
||||
// "fyne.io/fyne/v2/canvas"
|
||||
//)
|
||||
//
|
||||
//func main() {
|
||||
// size, err := strconv.Atoi(os.Args[1])
|
||||
// if err != nil {
|
||||
// // ... handle error
|
||||
// panic(err)
|
||||
// }
|
||||
//
|
||||
// a := app.New()
|
||||
// w := a.NewWindow("Alert")
|
||||
//
|
||||
// // Fullscreen red rectangle
|
||||
// rect := canvas.NewRectangle(color.RGBA{255, 0, 0, 255})
|
||||
// alertText := canvas.NewText("ALERT", color.RGBA{255, 255, 255, 255})
|
||||
// alertText.TextSize = float32(size) // Set text size
|
||||
// alertText.Move(fyne.NewPos(250, 250)) // Position the text
|
||||
// alertText.Alignment = fyne.TextAlignCenter
|
||||
//
|
||||
// w.SetContent(rect)
|
||||
// w.SetContent(alertText)
|
||||
// w.SetFullScreen(true)
|
||||
//
|
||||
// // Flashing animation
|
||||
// anim := canvas.NewColorRGBAAnimation(
|
||||
// color.RGBA{255, 0, 0, 255},
|
||||
// color.RGBA{0, 0, 0, 255},
|
||||
// 500*time.Millisecond,
|
||||
// func(c color.Color) {
|
||||
// rect.FillColor = c
|
||||
// rect.Refresh()
|
||||
// },
|
||||
// )
|
||||
//
|
||||
// anim.AutoReverse = true
|
||||
// anim.RepeatCount = fyne.AnimationRepeatForever
|
||||
// //anim.Start()
|
||||
//
|
||||
// w.ShowAndRun()
|
||||
//}
|
||||
Reference in New Issue
Block a user