appJar


This is a Python library for creating quick and easy GUIs, designed primarily for use in the classroom.

It has no dependencies, other than Python (Python 3.x or 2.7) and relies on Python's built-in tkinter library.

It's designed to be as easy to set-up as possible, specifically with schools in mind, so can just be downloaded and used.
See the installation guidelines for more information.

Let's make a sandwich


Making a GUI (using appJar) is just like making a sandwich!

You need a slice of bread on the top and bottom, and then a bunch of fillings in the middle ...

# import the library
from appJar import gui

# top slice - CREATE the GUI
app = gui()

### fillings go here ###

# bottom slice - START the GUI
app.go()

If you forget a slice of bread - you haven't got a sandwich!
Oh, and if you try to put fillings under the bottom-slice, then they won't be in the sandwich!

Add some fillings...


When making a sandwich, you could just stuff it with fillings:

But it's often nice to prepare the fillings too:

# import the library
from appJar import gui

# top slice - CREATE the GUI
app = gui()

### fillings go here ###
app.addLabel("title", "Welcome to appJar")
app.setLabelBg("title", "red")

# bottom slice - START the GUI
app.go()

simpleApp

And, that's it...
The more fillings you put in your sandwich, and the more time you spend making them look nice, the better it will taste!

Foot-long sub?


Of course, for most of us, a simple sandwich isn't enough...
We want to make a meal out of it!

In which case, you're going to want to arrange your fillings a bit more cleverly!

By default, in an appJar GUI, the fillings are simply stacked on top of each other.

However, filling a sub is very similar to filling a spreadsheet.
Simply tell each filling what layer (row) it's on, and what column it's in.
And, if you're not planning on chopping a filling, it might stretch (span) across more than one column.

See here for more.

from appJar import gui

# function called by pressing the buttons
def press(btn):
    if btn=="Cancel":
        app.stop()
    else:
        print("User:", app.getEntry('user'), "Pass:", app.getEntry('pass'))

app = gui()

app.addLabel("title", "Welcome to appJar", 0, 0, 2)  # Row 0,Column 0,Span 2
app.addLabel("user", "Username:", 1, 0)              # Row 1,Column 0
app.addEntry("user", 1, 1)                           # Row 1,Column 1
app.addLabel("pass", "Password:", 2, 0)              # Row 2,Column 0
app.addSecretEntry("pass", 2, 1)                     # Row 2,Column 1
app.addButtons(["Submit", "Cancel"], press, 3, 0, 2) # Row 3,Column 0,Span 2

app.setEntryFocus("user")

app.go()

testLog

Any extras?


It's possible to make changes to how the GUI looks
For starters, you can specify a name and size for your GUI when you make it:

And, you can choose what kind of bread, and whether it's toasted:

See here for more.

testLog

Make your own!


That's about it for now.
Have a look around, discover all of the different fillings available.
And, investigate how best to present your sandwich!