Open wsczx opened 1 week ago
I need more code, because this one works for me
package main
import (
"github.com/AllenDang/giu"
g "github.com/AllenDang/giu"
)
func loop() {
giu.SingleWindow().Layout(
g.Row(
g.Button("Save").OnClick(func() {
/*
if err := conf.SaveConfig(conf.Cfg); err != nil {
log.Printf("Configuration save failed: %s", err)
g.Msgbox("Warning", "Configuration save failed, please check the log!")
} else {
g.Msgbox("Tip:", "Configuration saved successfully!")
}
*/
}),
g.Button("Exit").OnClick(func() {
/*
systray.Quit()
os.Exit(0)
*/
}),
),
)
}
func main() {
wnd := giu.NewMasterWindow("Issue 807", 640, 480, 0)
wnd.Run(loop)
}
package main
import (
g "github.com/AllenDang/giu"
)
func main() {
w := g.NewMasterWindow("Test", 400, 350, g.MasterWindowFlagsNotResizable)
w.Run(loop)
}
func loop() {
g.SingleWindow().Layout(
// g.Align(g.AlignCenter).To(
g.Row(
g.Button("Save").OnClick(func() {}),
g.Button("Exit").OnClick(func() {}),
),
// ),
g.PrepareMsgbox(),
)
}
It seems that the Align (g. AlignCenter) was caused by the use of centering Using g.Align(g.AlignCenter). To will cause the buttons to not be arranged horizontally
What happend?
After upgrading to giu 0.8.0, I cannot use g.Row() to arrange Button widgets horizontally. 0.7.0 has no problem at all
Code example
```golang g.Row( g.Button("Save").OnClick(func() { if err := conf.SaveConfig(conf.Cfg); err != nil { log.Printf("Configuration save failed: %s", err) g.Msgbox("Warning", "Configuration save failed, please check the log!") } else { g.Msgbox("Tip:", "Configuration saved successfully!") } }), g.Button("Exit").OnClick(func() { systray.Quit() os.Exit(0) }), ), ```main.go
To Reproduce
Version
(latest)
OS
Windows11