Skip to content

Commit

Permalink
Restyle renabled in loopcontrol.
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoreilly committed Jun 17, 2024
1 parent 536939a commit 6b4c747
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions egui/loopctrl.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ func (gui *GUI) AddLooperCtrl(p *core.Plan, loops *looper.Manager, modes []etime
for _, m := range modes {
mode := m
core.AddAt(p, mode.String()+"-run", func(w *core.Button) {
tb := p.Widget.(*core.Toolbar)

Check failure on line 34 in egui/loopctrl.go

View workflow job for this annotation

GitHub Actions / build

p.Widget undefined (type *"cogentcore.org/core/core".Plan has no field or method Widget)
w.SetText(mode.String() + " Run").SetIcon(icons.PlayArrow).
SetTooltip("Run the " + mode.String() + " process").
FirstStyler(func(s *styles.Style) { s.SetEnabled(!gui.IsRunning) }).
OnClick(func(e events.Event) {
if !gui.IsRunning {
gui.IsRunning = true
// tb.Restyle() // todo: need obj on plan
tb.Restyle()
go func() {
loops.Run(mode)
gui.Stopped()
Expand All @@ -55,6 +56,7 @@ func (gui *GUI) AddLooperCtrl(p *core.Plan, loops *looper.Manager, modes []etime
}

core.AddAt(p, mode.String()+"-step", func(w *core.Button) {
tb := p.Widget.(*core.Toolbar)

Check failure on line 59 in egui/loopctrl.go

View workflow job for this annotation

GitHub Actions / build

p.Widget undefined (type *"cogentcore.org/core/core".Plan has no field or method Widget)
w.SetText("Step").SetIcon(icons.SkipNext).
SetTooltip("Step the " + mode.String() + " process according to the following step level and N").
FirstStyler(func(s *styles.Style) {
Expand All @@ -64,7 +66,7 @@ func (gui *GUI) AddLooperCtrl(p *core.Plan, loops *looper.Manager, modes []etime
OnClick(func(e events.Event) {
if !gui.IsRunning {
gui.IsRunning = true
// tb.Restyle()
tb.Restyle()
go func() {
stack := loops.Stacks[mode]
loops.Step(mode, stepN[stack.StepLevel.String()], stack.StepLevel)
Expand Down

0 comments on commit 6b4c747

Please sign in to comment.