-
-
Notifications
You must be signed in to change notification settings - Fork 93
Closed
Labels
approvedThis feature request will be implementedThis feature request will be implementedenhancementA new feature requestA new feature request
Milestone
Description
Describe the bug
Providing GrowWrap = true to a new body makes it unable to display any content. Settings are taken directly from https://www.cogentcore.org/core/advanced/styling/.
Expected behavior: the windows contains a text widget with "Picker" and a picker with options "foo" and "bar". The window wraps tightly around contents of the child frame.
Result: a black window appears with a 0,0 box
How to reproduce
core run the code in the issue
Example code
package main
import (
"fmt"
"cogentcore.org/core/core"
"cogentcore.org/core/events"
"cogentcore.org/core/styles"
"cogentcore.org/core/styles/units"
)
func main() {
b := core.NewBody()
b.Styler(func(s *styles.Style) {
s.GrowWrap = true
s.Gap.X = units.Value{Value: 0.5, Unit: units.UnitEm}
s.Gap.Y = units.Value{Value: 0.5, Unit: units.UnitEm}
})
fr := core.NewFrame(b)
fr.Styler(func(s *styles.Style) {
s.Align = styles.AlignSet{Items: styles.Center}
})
t := core.NewText(fr).SetText("Picker")
t.Styler(func(s *styles.Style) {
s.SetTextWrap(false)
})
ch := core.NewChooser(fr).SetStrings("foo", "bar")
ch.OnChange(func(e events.Event) {
core.MessageSnackbar(fr, fmt.Sprintf("Selected %v", ch.CurrentItem.Value))
})
b.RunMainWindow()
}Relevant output
No response
Platform
Windows
Metadata
Metadata
Assignees
Labels
approvedThis feature request will be implementedThis feature request will be implementedenhancementA new feature requestA new feature request