Skip to content

Commit

Permalink
New function to raise a frame #345
Browse files Browse the repository at this point in the history
  • Loading branch information
jarvisteach committed Mar 3, 2018
1 parent 45884a5 commit 40836d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions appJar/appjar.py
Expand Up @@ -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
#####################################
Expand Down
6 changes: 2 additions & 4 deletions examples/issues/issue345.py
Expand Up @@ -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):
Expand Down

0 comments on commit 40836d9

Please sign in to comment.