Open gucio321 opened 2 years ago
look arrow, wrong syntax (smile)
@gadmin88 the syntax have changed since https://github.com/AllenDang/giu/pull/486 , the new code example should look as follows
package main
import (
g "github.com/AllenDang/giu"
)
var sashPos float32 = 80
func loop() {
g.Window("wnd").Size(80, 80).Layout(
g.SplitLayout(g.DirectionHorizontal, &sashPos,
g.Layout{
g.Label("Test1"),
},
g.Layout{
g.Label("Test2"),
},
),
)
}
func main() {
w := g.NewMasterWindow("Splitter", 640, 480, 0)
w.Run(loop)
}
and it still crashes
@gadmin88 you're using wrong version! since #486 pointer is required. However it is off-topic here
@gadmin88 you're using wrong version! since #486 pointer is required. However it is off-topic here
Just tested for you, the GIT-Master Version, it dit NOT crash 👍
Take a look at this part: Assertion `size_arg.x != 0.0f && size_arg.y != 0.0f' failed.
ok, I think I understand what's going on here. VSplitter has the following in its Size method:
aw, ah := GetAvailableRegion()
// ...
if height == 0 {
v.height = ah
} else {
v.height = height
}
and sometimes height == 0 && availableHeight === 0 this causes panic
Hi there!
demo code
panic message
to reproduce