Skip to content

Commit e619cee

Browse files
authored
Merge pull request #139 from emer/cmd
Add generic helper functions to egui to reduce sim boilerplate
2 parents 56587d3 + b3e6d48 commit e619cee

File tree

7 files changed

+218
-57
lines changed

7 files changed

+218
-57
lines changed

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
go-version: '1.23.4'
2020

2121
- name: Set up Core
22-
run: go install cogentcore.org/core/cmd/core@main && core setup
22+
run: go install cogentcore.org/core@main && core setup
2323

2424
- name: Build
2525
run: go build -v ./...

egui/config.go

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// Copyright (c) 2025, The Emergent Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
package egui
6+
7+
import (
8+
"cogentcore.org/core/base/errors"
9+
"cogentcore.org/core/base/reflectx"
10+
"cogentcore.org/core/core"
11+
"cogentcore.org/core/system"
12+
)
13+
14+
// Config is an interface implemented by all [Sim] config types.
15+
// To implement Config, you must embed [BaseConfig]. You must
16+
// implement [Config.Defaults] yourself.
17+
type Config interface {
18+
19+
// AsBaseConfig returns the embedded [BaseConfig].
20+
AsBaseConfig() *BaseConfig
21+
22+
// Defaults sets default values for config fields.
23+
// Helper functions such as [Run], [Embed], and [NewConfig] already set defaults
24+
// based on struct tags, so you only need to set non-tag-based defaults here.
25+
Defaults()
26+
}
27+
28+
// BaseConfig contains the basic configuration parameters common to all sims.
29+
type BaseConfig struct {
30+
31+
// Name is the short name of the sim.
32+
Name string `display:"-"`
33+
34+
// Title is the longer title of the sim.
35+
Title string `display:"-"`
36+
37+
// URL is a link to the online README or other documentation for this sim.
38+
URL string `display:"-"`
39+
40+
// Doc is brief documentation of the sim.
41+
Doc string `display:"-"`
42+
43+
// Includes has a list of additional config files to include.
44+
// After configuration, it contains list of include files added.
45+
Includes []string
46+
47+
// GUI indicates to open the GUI. Otherwise it runs automatically and quits,
48+
// saving results to log files.
49+
GUI bool `default:"true"`
50+
51+
// Debug indicates to report debugging information.
52+
Debug bool
53+
54+
// GPU indicates to use the GPU for computation. This is on by default, except
55+
// on web, where it is currently off by default.
56+
GPU bool
57+
}
58+
59+
func (bc *BaseConfig) AsBaseConfig() *BaseConfig { return bc }
60+
61+
func (bc *BaseConfig) IncludesPtr() *[]string { return &bc.Includes }
62+
63+
// BaseDefaults sets default values not specified by struct tags.
64+
// It is called automatically by [NewConfig].
65+
func (bc *BaseConfig) BaseDefaults() {
66+
bc.GPU = core.TheApp.Platform() != system.Web // GPU compute not fully working on web yet
67+
}
68+
69+
// NewConfig makes a new [Config] of type *C with defaults set.
70+
func NewConfig[C any]() (*C, Config) { //yaegi:add
71+
cfgC := new(C)
72+
cfg := any(cfgC).(Config)
73+
74+
errors.Log(reflectx.SetFromDefaultTags(cfg))
75+
cfg.AsBaseConfig().BaseDefaults()
76+
cfg.Defaults()
77+
return cfgC, cfg
78+
}

egui/sim.go

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
// Copyright (c) 2025, The Emergent Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
package egui
6+
7+
import (
8+
"cogentcore.org/core/cli"
9+
"cogentcore.org/core/core"
10+
"cogentcore.org/core/tree"
11+
)
12+
13+
// Sim is an interface implemented by all sim types.
14+
// It is parameterized by the config type C. *C must implement [Config].
15+
//
16+
// See [Run], [RunSim], and [Embed].
17+
type Sim[C any] interface {
18+
19+
// SetConfig sets the sim config.
20+
SetConfig(cfg *C)
21+
22+
ConfigSim()
23+
Init()
24+
ConfigGUI(b tree.Node)
25+
26+
// Body returns the [core.Body] used by the sim.
27+
Body() *core.Body
28+
29+
RunNoGUI()
30+
}
31+
32+
// Run runs a sim of the given type S with config type C. *S must implement [Sim][C]
33+
// (interface [Sim] parameterized by config type C), and *C must implement [Config].
34+
//
35+
// This is a high-level helper function designed to be called as one-liner
36+
// from the main() function of the sim's command subdirectory with package main.
37+
// This subdirectory has the same name as the sim name itself, ex: sims/ra25
38+
// has the package with the sim logic, and sims/ra25/ra25 has the compilable main().
39+
//
40+
// Run uses the config type C to make a new [Config] object and set its default values
41+
// with [Config.Defaults].
42+
func Run[S, C any]() {
43+
cfgC, cfg := NewConfig[C]()
44+
45+
bc := cfg.AsBaseConfig()
46+
opts := cli.DefaultOptions(bc.Name, bc.Title)
47+
opts.DefaultFiles = append(opts.DefaultFiles, "config.toml")
48+
opts.SearchUp = true // so that the sim can be run from the command subdirectory
49+
50+
cli.Run(opts, cfgC, RunSim[S, C])
51+
}
52+
53+
// RunSim runs a sim with the given config. *S must implement [Sim][C]
54+
// (interface [Sim] parameterized by config type C).
55+
//
56+
// Unlike [Run], this does not handle command-line config parsing. End users
57+
// should typically use [Run], which uses RunSim under the hood.
58+
func RunSim[S, C any](cfg *C) error {
59+
simS := new(S)
60+
sim := any(simS).(Sim[C])
61+
62+
bc := any(cfg).(Config).AsBaseConfig()
63+
64+
sim.SetConfig(cfg)
65+
sim.ConfigSim()
66+
67+
if bc.GUI {
68+
sim.Init()
69+
sim.ConfigGUI(nil)
70+
sim.Body().RunMainWindow()
71+
} else {
72+
sim.RunNoGUI()
73+
}
74+
return nil
75+
}
76+
77+
// Embed runs a sim with the default config, embedding it under the given parent node.
78+
// It returns the resulting sim. *S must implement [Sim][C] (interface [Sim]
79+
// parameterized by config type C).
80+
//
81+
// See also [Run] and [RunSim].
82+
func Embed[S, C any](parent tree.Node) *S { //yaegi:add
83+
cfgC, cfg := NewConfig[C]()
84+
85+
cfg.AsBaseConfig().GUI = true // force GUI on
86+
87+
simS := new(S)
88+
sim := any(simS).(Sim[C])
89+
90+
sim.SetConfig(cfgC)
91+
sim.ConfigSim()
92+
sim.Init()
93+
sim.ConfigGUI(parent)
94+
return simS
95+
}

go.mod

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,28 @@ module github.com/emer/emergent/v2
33
go 1.23.4
44

55
require (
6-
cogentcore.org/core v0.3.12-0.20250629235109-951ce94de7ce
7-
cogentcore.org/lab v0.1.2-0.20250630010756-c98eff592de2
6+
cogentcore.org/core v0.3.12
7+
cogentcore.org/lab v0.1.2
8+
github.com/cogentcore/yaegi v0.0.0-20250622201820-b7838bdd95eb
89
github.com/stretchr/testify v1.10.0
910
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948
1011
)
1112

1213
require (
1314
github.com/Bios-Marcel/wastebasket/v2 v2.0.3 // indirect
1415
github.com/Masterminds/vcs v1.13.3 // indirect
15-
github.com/adrg/strutil v0.3.1 // indirect
1616
github.com/alecthomas/chroma/v2 v2.13.0 // indirect
1717
github.com/anthonynsimon/bild v0.13.0 // indirect
1818
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
1919
github.com/aymerick/douceur v0.2.0 // indirect
20-
github.com/bramvdbogaerde/go-scp v1.4.0 // indirect
2120
github.com/chewxy/math32 v1.10.1 // indirect
22-
github.com/cogentcore/readline v0.1.3 // indirect
2321
github.com/cogentcore/webgpu v0.23.0 // indirect
24-
github.com/cogentcore/yaegi v0.0.0-20250622201820-b7838bdd95eb // indirect
2522
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
2623
github.com/dlclark/regexp2 v1.11.0 // indirect
27-
github.com/ericchiang/css v1.3.0 // indirect
2824
github.com/fsnotify/fsnotify v1.8.0 // indirect
2925
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20240506104042-037f3cc74f2a // indirect
3026
github.com/go-text/typesetting v0.3.1-0.20250402122313-7a0f05577ff5 // indirect
3127
github.com/gobwas/glob v0.2.3 // indirect
32-
github.com/gomarkdown/markdown v0.0.0-20250311123330-531bef5e742b // indirect
3328
github.com/gorilla/css v1.0.1 // indirect
3429
github.com/h2non/filetype v1.1.3 // indirect
3530
github.com/hack-pad/go-indexeddb v0.3.2 // indirect
@@ -46,14 +41,12 @@ require (
4641
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
4742
github.com/rivo/uniseg v0.4.7 // indirect
4843
github.com/tdewolff/parse/v2 v2.7.19 // indirect
49-
golang.org/x/crypto v0.38.0 // indirect
5044
golang.org/x/image v0.25.0 // indirect
51-
golang.org/x/mod v0.20.0 // indirect
52-
golang.org/x/net v0.40.0 // indirect
53-
golang.org/x/sync v0.14.0 // indirect
45+
golang.org/x/mod v0.25.0 // indirect
46+
golang.org/x/net v0.41.0 // indirect
47+
golang.org/x/sync v0.15.0 // indirect
5448
golang.org/x/sys v0.33.0 // indirect
55-
golang.org/x/text v0.25.0 // indirect
56-
golang.org/x/tools v0.24.0 // indirect
57-
gonum.org/v1/gonum v0.15.0 // indirect
49+
golang.org/x/text v0.26.0 // indirect
50+
golang.org/x/tools v0.33.0 // indirect
5851
gopkg.in/yaml.v3 v3.0.1 // indirect
5952
)

go.sum

Lines changed: 14 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
cogentcore.org/core v0.3.12-0.20250629235109-951ce94de7ce h1:sF2rNFNzzof1mW/ZkbxjEFgd5mZC52V4qgtbY4F80AA=
2-
cogentcore.org/core v0.3.12-0.20250629235109-951ce94de7ce/go.mod h1:A82XMVcq3XOiG9TpT+rt7/iYD5Eu87bxxmTk8O7F4cM=
3-
cogentcore.org/lab v0.1.2-0.20250630010756-c98eff592de2 h1:2zN5G7o1ooCe0KtWDkzHtpDeRfe7XzdqYkA80lWDNnI=
4-
cogentcore.org/lab v0.1.2-0.20250630010756-c98eff592de2/go.mod h1:OyOmVcm48Owu9MIIn8alw3UCyaNKHiq4i+ZkUq+nQow=
1+
cogentcore.org/core v0.3.12 h1:wniqGY3wB+xDcJ3KfobR7VutWeiZafSQkjnbOW4nAXQ=
2+
cogentcore.org/core v0.3.12/go.mod h1:Bwg3msVxqnfwvmQjpyJbyHMeox3UAcBcBitkGEdSYSE=
3+
cogentcore.org/lab v0.1.2 h1:km5VUi3HVmP28maFnCvNgGXV4bGMjlPAXFIHchaRZ4k=
4+
cogentcore.org/lab v0.1.2/go.mod h1:ilGaPEvvAVCHiUxpO83w01g1+Ix0tJxK+fnAmnLNOMk=
55
github.com/Bios-Marcel/wastebasket/v2 v2.0.3 h1:TkoDPcSqluhLGE+EssHu7UGmLgUEkWg7kNyHyyJ3Q9g=
66
github.com/Bios-Marcel/wastebasket/v2 v2.0.3/go.mod h1:769oPCv6eH7ugl90DYIsWwjZh4hgNmMS3Zuhe1bH6KU=
77
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
88
github.com/Masterminds/vcs v1.13.3 h1:IIA2aBdXvfbIM+yl/eTnL4hb1XwdpvuQLglAix1gweE=
99
github.com/Masterminds/vcs v1.13.3/go.mod h1:TiE7xuEjl1N4j016moRd6vezp6e6Lz23gypeXfzXeW8=
10-
github.com/adrg/strutil v0.3.1 h1:OLvSS7CSJO8lBii4YmBt8jiK9QOtB9CzCzwl4Ic/Fz4=
11-
github.com/adrg/strutil v0.3.1/go.mod h1:8h90y18QLrs11IBffcGX3NW/GFBXCMcNg4M7H6MspPA=
1210
github.com/alecthomas/assert/v2 v2.6.0 h1:o3WJwILtexrEUk3cUVal3oiQY2tfgr/FHWiz/v2n4FU=
1311
github.com/alecthomas/assert/v2 v2.6.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k=
1412
github.com/alecthomas/chroma/v2 v2.13.0 h1:VP72+99Fb2zEcYM0MeaWJmV+xQvz5v5cxRHd+ooU1lI=
@@ -22,12 +20,8 @@ github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiE
2220
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
2321
github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
2422
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
25-
github.com/bramvdbogaerde/go-scp v1.4.0 h1:jKMwpwCbcX1KyvDbm/PDJuXcMuNVlLGi0Q0reuzjyKY=
26-
github.com/bramvdbogaerde/go-scp v1.4.0/go.mod h1:on2aH5AxaFb2G0N5Vsdy6B0Ml7k9HuHSwfo1y0QzAbQ=
2723
github.com/chewxy/math32 v1.10.1 h1:LFpeY0SLJXeaiej/eIp2L40VYfscTvKh/FSEZ68uMkU=
2824
github.com/chewxy/math32 v1.10.1/go.mod h1:dOB2rcuFrCn6UHrze36WSLVPKtzPMRAQvBvUwkSsLqs=
29-
github.com/cogentcore/readline v0.1.3 h1:tYmjP3XHvsGwhsDLkAp+vBhkERmLFENZfftyPOR/PBE=
30-
github.com/cogentcore/readline v0.1.3/go.mod h1:IHVtJHSKXspK7CMg3OC/bbPEXxO++dFlug/vsPktvas=
3125
github.com/cogentcore/webgpu v0.23.0 h1:hrjnnuDZAPSRsqBjQAsJOyg2COGztIkBbxL87r0Q9KE=
3226
github.com/cogentcore/webgpu v0.23.0/go.mod h1:ciqaxChrmRRMU1SnI5OE12Cn3QWvOKO+e5nSy+N9S1o=
3327
github.com/cogentcore/yaegi v0.0.0-20250622201820-b7838bdd95eb h1:vXYqPLO36pRyyk1cVILVlk+slDI+Q7N4bgeWlh1sjA0=
@@ -42,8 +36,6 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1
4236
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4337
github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI=
4438
github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
45-
github.com/ericchiang/css v1.3.0 h1:e0vS+vpujMjtT3/SYu7qTHn1LVzXWcLCCDjlfq3YlLY=
46-
github.com/ericchiang/css v1.3.0/go.mod h1:sVSdL+MFR9Q4cKJMQzpIkHIDOLiK+7Wmjjhq7D+MubA=
4739
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
4840
github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M=
4941
github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
@@ -57,9 +49,6 @@ github.com/go-text/typesetting-utils v0.0.0-20241103174707-87a29e9e6066 h1:qCuYC
5749
github.com/go-text/typesetting-utils v0.0.0-20241103174707-87a29e9e6066/go.mod h1:DDxDdQEnB70R8owOx3LVpEFvpMK9eeH1o2r0yZhFI9o=
5850
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
5951
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
60-
github.com/gomarkdown/markdown v0.0.0-20250311123330-531bef5e742b h1:EY/KpStFl60qA17CptGXhwfZ+k1sFNJIUNR8DdbcuUk=
61-
github.com/gomarkdown/markdown v0.0.0-20250311123330-531bef5e742b/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA=
62-
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
6352
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
6453
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
6554
github.com/gorilla/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8=
@@ -131,39 +120,26 @@ github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739/go.mod h1:XPuWBzv
131120
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
132121
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
133122
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
134-
golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8=
135-
golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw=
136123
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA=
137124
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ=
138125
golang.org/x/image v0.0.0-20190703141733-d6a02ce849c9/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
139126
golang.org/x/image v0.25.0 h1:Y6uW6rH1y5y/LK1J8BPWZtr6yZ7hrsy6hFrXjgsc2fQ=
140127
golang.org/x/image v0.25.0/go.mod h1:tCAmOEGthTtkalusGp1g3xa2gke8J6c2N565dTyl9Rs=
141-
golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
142-
golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
143-
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
144-
golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
145-
golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
146-
golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
147-
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
128+
golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w=
129+
golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
130+
golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw=
131+
golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA=
132+
golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8=
133+
golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
148134
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
149-
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
150-
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
151135
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
152136
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
153137
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
154-
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
155-
golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg=
156-
golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
157138
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
158-
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
159-
golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
160-
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
161-
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
162-
golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
163-
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
164-
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
165-
gonum.org/v1/gonum v0.15.0 h1:2lYxjRbTYyxkJxlhC+LvJIx3SsANPdRybu1tGj9/OrQ=
166-
gonum.org/v1/gonum v0.15.0/go.mod h1:xzZVBJBtS+Mz4q0Yl2LJTk+OxOg4jiXZ7qBoM0uISGo=
139+
golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M=
140+
golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
141+
golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc=
142+
golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI=
167143
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
168144
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
169145
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

netview/netview.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,9 @@ func (nv *NetView) Init() {
128128
})
129129
})
130130
tree.AddChildAt(nv, "counters", func(w *core.Text) {
131-
w.SetText("Counters: " + strings.Repeat(" ", 200)).
131+
w.SetText("Counters: ").
132132
Styler(func(s *styles.Style) {
133-
s.Max.X.Pw(95)
134-
s.Min.X.Pw(95)
133+
s.Min.X.Pw(90)
135134
})
136135
w.Updater(func() {
137136
if w.Text != nv.CurCtrs && nv.CurCtrs != "" {

yaegiemergent/github_com-emer-emergent-v2-egui.go

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)