Skip to content

Commit

Permalink
update to various core cleanup changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoreilly committed Jul 9, 2024
1 parent 94898e9 commit ee294cd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 20 deletions.
9 changes: 1 addition & 8 deletions canvas/canvas.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,15 +546,8 @@ func (vv *Canvas) SetTitle() {
if vv.Filename == "" {
return
}
win := vv.Scene.RenderWindow()
if win == nil {
return
}
dfnm := fsx.DirAndFile(string(vv.Filename))
winm := "Cogent Canvas • " + dfnm
win.SetName(winm)
win.SetTitle(winm)
vv.Scene.Body.Title = winm
vv.Scene.Body.SetTitle("Cogent Canvas • " + dfnm)
}

// NewDrawing opens a new drawing window
Expand Down
5 changes: 1 addition & 4 deletions code/debugpanel.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,7 @@ func (dv *DebugPanel) Continue() {
}
}
if dv.Code != nil {
sc := dv.Code.AsWidget().Scene
if sc != nil && sc.Stage.Mains != nil {
sc.Stage.Mains.RenderWindow.Raise()
}
dv.Code.Events().RenderWindow().Raise()
}
if ds != nil {
dv.InitState(ds)
Expand Down
18 changes: 10 additions & 8 deletions numbers/cmd/numbers/numbers.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"cogentcore.org/core/base/fsx"
"cogentcore.org/core/cli"
"cogentcore.org/core/core"
"cogentcore.org/core/events"
"cogentcore.org/core/shell"
"cogentcore.org/core/shell/interpreter"
"github.com/traefik/yaegi/interp"
Expand Down Expand Up @@ -105,14 +106,15 @@ func Interactive(c *Config) error {
in.Interp.Use(databrowser.Symbols)
in.Config()

w := b.RunWindow()
go func() {
if c.Expr != "" {
in.Eval(c.Expr)
}
in.Interactive()
}()
w.Wait()
b.OnShow(func(e events.Event) {
go func() {
if c.Expr != "" {
in.Eval(c.Expr)
}
in.Interactive()
}()
})
b.RunMainWindow()
return nil
}

Expand Down

0 comments on commit ee294cd

Please sign in to comment.