gocui: update on add kinda working now
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
ce7e51bafa
commit
af41bdfc59
|
@ -80,6 +80,9 @@ func (w *cuiWidget) addWidget() {
|
|||
default:
|
||||
w.startW = w.parent.startW
|
||||
w.startH = w.parent.startH
|
||||
if w.IsCurrent() {
|
||||
w.updateCurrent()
|
||||
}
|
||||
}
|
||||
w.showWidgetPlacement(logInfo, "addWidget()")
|
||||
}
|
||||
|
|
|
@ -25,6 +25,28 @@ func updateCurrentTabs() {
|
|||
me.rootNode.redoTabs(true)
|
||||
}
|
||||
|
||||
// when adding a new widget, this will update the display
|
||||
// of the current widgets if that widget is supposed
|
||||
// to be in current display
|
||||
func (w *cuiWidget) updateCurrent() {
|
||||
if w.widgetType == toolkit.Tab {
|
||||
if w.IsCurrent() {
|
||||
setCurrentTab(w)
|
||||
}
|
||||
return
|
||||
}
|
||||
if w.widgetType == toolkit.Window {
|
||||
if w.IsCurrent() {
|
||||
setCurrentWindow(w)
|
||||
}
|
||||
return
|
||||
}
|
||||
if w.widgetType == toolkit.Root {
|
||||
return
|
||||
}
|
||||
w.parent.updateCurrent()
|
||||
}
|
||||
|
||||
// shows the widgets in a window
|
||||
func setCurrentWindow(w *cuiWidget) {
|
||||
if w.widgetType != toolkit.Window {
|
||||
|
|
Loading…
Reference in New Issue