diff --git a/appJar/appjar.py b/appJar/appjar.py index b5bc576..2bcbbb0 100644 --- a/appJar/appjar.py +++ b/appJar/appjar.py @@ -5185,6 +5185,11 @@ def stopFrame(self): self._getContainerProperty('type')) self.stopContainer() + def raiseFrame(self, title): + ''' will bring the named frame in front of any others ''' + gui.trace("Raising frame: %s", title) + self.widgetManager.get(self.Widgets.Frame, title).lift() + ##################################### # SubWindows ##################################### diff --git a/examples/issues/issue345.py b/examples/issues/issue345.py index da22339..4c41223 100644 --- a/examples/issues/issue345.py +++ b/examples/issues/issue345.py @@ -5,11 +5,9 @@ current = 0 def up(): - global current - current += 1 - if current > 5: current = 1 - app.getFrameWidget(str(current)).lift() + current = 1 if current > 4 else current + 1 + app.raiseFrame(str(current)) with gui() as app: with app.frame("1", bg='red', row=0, column=0):