jarvisteach / appJar

Simple Tkinter GUIs in Python
http://appJar.info
Other
615 stars 67 forks source link

[Feature request] Z-axis for images #603

Closed zombiestruck closed 4 years ago

zombiestruck commented 4 years ago

This may simply be a bug, I am not sure. No matter where I put the image in the draw order, it covers everything on the gui. If this is not a bug, a z-axis, app.backgroundImage or draw order would be much appreciated.

zombiestruck commented 4 years ago

app = gui("testing", "400x300")

app.addLabel("title", "Test Application")
app.setBg("white")

def press(button):
    if button == "1":
        app.stop()
    else:
        app.stop()
app.addImage("test", "test.gif")
app.addButtons(["1", "2"], press)
app.setButtonFont(size=14, family="Verdana", underline=False, slant="roman")

app.go()
jarvisteach commented 4 years ago

That code looks like it should work fine - the widgets are added in sequence, so there should be a label, then an image then buttons underneath.

If it's a huge image, it may be skewing things up a bit...

It is possible to set a background image: http://appjar.info/pythonImages/#set-background-images

jarvisteach commented 4 years ago

However, there is the ability to change the stack order of widgets:

widget.lift()          # move to the top of the stack
widget.lift(another)   # move to just above another widget
widget.lower()         # move to the bottom of the stack
widget.lower(another)  # move to just below another widget

This is used in some container widgets already, but could be introduced for all widgets, to allow the changing of stack order in a single grid cell...