From 25dae7999b6869b94bd1d2bf9d81b6a2f0a92097 Mon Sep 17 00:00:00 2001 From: John Wiedey Date: Wed, 29 Apr 2020 22:17:34 -0400 Subject: [PATCH] Fix imageviewer example --- examples/imageviewer/imageviewer.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/examples/imageviewer/imageviewer.go b/examples/imageviewer/imageviewer.go index 844d2ba1..1967e9c0 100644 --- a/examples/imageviewer/imageviewer.go +++ b/examples/imageviewer/imageviewer.go @@ -49,15 +49,18 @@ func main() { }, }, }, - ToolBarItems: []MenuItem{ - ActionRef{&openAction}, - }, MinSize: Size{320, 240}, Size: Size{800, 600}, Layout: VBox{MarginsZero: true}, Children: []Widget{ TabWidget{ AssignTo: &mw.tabWidget, + Pages: []TabPage{ + TabPage{ + Layout: HBox{}, + Name: "placeholder", + }, + }, }, }, }.Run()); err != nil { @@ -147,6 +150,10 @@ func (mw *MyMainWindow) openImage() error { succeeded = true + if mw.tabWidget.Pages().At(0).Name() == "placeholder" { + mw.tabWidget.Pages().Remove(mw.tabWidget.Pages().At(0)) + } + return nil }