mirror of
https://github.com/gravitl/netmaker.git
synced 2024-11-14 13:44:37 +08:00
25 lines
550 B
Go
25 lines
550 B
Go
package views
|
|
|
|
import (
|
|
"fyne.io/fyne/v2"
|
|
)
|
|
|
|
// CurrentContent - the content currently being displayed
|
|
var CurrentContent *fyne.Container
|
|
|
|
// RemoveContent - removes a rendered content
|
|
func RemoveContent(name string) {
|
|
CurrentContent.Remove(GetView(name))
|
|
}
|
|
|
|
// AddContent - adds content to be rendered
|
|
func AddContent(name string) {
|
|
CurrentContent.Add(GetView(name))
|
|
}
|
|
|
|
// RefreshComponent - refreshes the component to re-render
|
|
func RefreshComponent(name string, c fyne.CanvasObject) {
|
|
RemoveContent(name)
|
|
SetView(name, c)
|
|
AddContent(name)
|
|
}
|