Skip to content

Commit

Permalink
skip display- vars and other NewTab updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoreilly committed Aug 25, 2024
1 parent aba822d commit c917a13
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion egui/grids.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (gui *GUI) SaveActRFGrid(tg *tensorcore.TensorGrid, name string) {
func (gui *GUI) AddActRFGridTabs(arfs *actrf.RFs) {
for _, rf := range arfs.RFs {
nm := rf.Name
tf := gui.Tabs.NewTab(nm)
tf, _ := gui.Tabs.NewTab(nm)
tg := tensorcore.NewTensorGrid(tf)
gui.SaveActRFGrid(tg, nm)
}
Expand Down
2 changes: 1 addition & 1 deletion egui/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (gui *GUI) MakeBody(sim any, appname, title, about string) {

// AddNetView adds NetView in tab with given name
func (gui *GUI) AddNetView(tabName string) *netview.NetView {
nvt := gui.Tabs.NewTab(tabName)
nvt, _ := gui.Tabs.NewTab(tabName)
nv := netview.NewNetView(nvt)
nv.Var = "Act"
return nv
Expand Down
7 changes: 4 additions & 3 deletions egui/plots.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (gui *GUI) AddPlots(title string, lg *elog.Logs) {
// AddMiscPlotTab adds a misc (non log-generated) plot with a new
// tab and plot of given name.
func (gui *GUI) AddMiscPlotTab(name string) *plotcore.PlotEditor {
tab := gui.Tabs.NewTab(name)
tab, _ := gui.Tabs.NewTab(name)
plt := plotcore.NewSubPlot(tab)
gui.SetPlotByName(name, plt)
return plt
Expand Down Expand Up @@ -200,7 +200,8 @@ func (gui *GUI) GoUpdateCyclePlot(mode etime.Modes, cycle int) *plotcore.PlotEdi
// and using given tab label. For ad-hoc plots, you can
// construct a ScopeKey from any two strings using etime.ScopeStr.
func (gui *GUI) NewPlotTab(key etime.ScopeKey, tabLabel string) *plotcore.PlotEditor {
plt := plotcore.NewSubPlot(gui.Tabs.NewTab(tabLabel))
tab, _ := gui.Tabs.NewTab(tabLabel)
plt := plotcore.NewSubPlot(tab)
gui.Plots[key] = plt
return plt
}
Expand All @@ -219,7 +220,7 @@ func (gui *GUI) AddTableView(lg *elog.Logs, mode etime.Modes, time etime.Times)
return nil
}

tt := gui.Tabs.NewTab(mode.String() + " " + time.String() + " ")
tt, _ := gui.Tabs.NewTab(mode.String() + " " + time.String() + " ")
tv := tensorcore.NewTable(tt)
gui.TableViews[key] = tv
tv.SetReadOnly(true)
Expand Down
7 changes: 5 additions & 2 deletions netview/netview.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,8 @@ func (nv *NetView) makeVars(netframe *core.Frame) {
})
tabs := make(map[string]*core.Frame)
for _, ct := range cats {
tf := w.NewTab(ct.Cat)
// todo: no way to set tooltip!?
tf, tb := w.NewTab(ct.Cat)

Check failure on line 518 in netview/netview.go

View workflow job for this annotation

GitHub Actions / build

assignment mismatch: 2 variables but w.NewTab returns 1 value
tb.Tooltip = ct.Desc
tabs[ct.Cat] = tf
tf.Styler(func(s *styles.Style) {
s.Display = styles.Grid
Expand All @@ -541,6 +541,9 @@ func (nv *NetView) makeVars(netframe *core.Frame) {
rstr := reflect.StructTag(pstr)
desc = rstr.Get("desc")
cat = rstr.Get("cat")
if rstr.Get("display") == "-" {
continue
}
}
tf, ok := tabs[cat]
if !ok {
Expand Down

0 comments on commit c917a13

Please sign in to comment.