Beta Widgets


The following widgets are in beta.
They're available and in use, they're just not quite complete, and not fully tested...

MicroBit Emulator


Widget to emulate a MicroBit

MicroBit Emulator

    app.addMicroBit("mb1")
    app.setMicroBitImage("mb1", "09090:90909:90009:09090:00900")
    app.go()

Add MicroBits

Set MicroBits

PieChart


Widget to depict a Pie Chart.
It will automatically calculate percentages, and draw a pie chart, given a dictionary of items and their amount.
The PieChart is purely for display purposes, and is not interactive.
PieChart

    from appJar import gui

    app=gui()
    app.addPieChart("p1", {"apples":50, "oranges":200, "grapes":75,
                            "beef":300, "turkey":150})
    app.go()

Add PieCharts

Set PieCharts

Tree


Takes an arbitrary XML string, and converts it into a tree structure.

TreeWidget

from appJar import gui

app=gui()
app.addTree("t1",
            """<people>
            <person><name>Fred</name><age>45</age><gender>Male</gender></person>
            <person><name>Tina</name><age>37</age><gender>Female</gender></person>
            <person><name>CLive</name><age>28</age><gender>Male</gender></person>
            <person><name>Betty</name><age>51</age><gender>Female</gender></person>
            </people>""")
app.go()

Add Trees

Set Trees

Get Trees

Grid


Used to create a spreadsheet like interface.
The grid has mouse interactivity, with mouse-over highlighting, and mouse-click highlighting.
It is possible to include buttons at the end of each row, and an additional row of entry boxes, with their own button.

Grid

    from appJar import gui

    app=gui()
    app.setFont(20)
    app.addGrid("g1",
        [["Name", "Age", "Gender"],
        ["Fred", 45, "Male"],
        ["Tina", 37, "Female"],
        ["Clive", 28, "Male"],
        ["Betty", 51, "Female"]])
    app.go()

Add Grids

Get Grids

Set Grids

To have the Press button on the entries row add a new row of data, try the following:

def press(btn):
    if btn == "Press":     # the button on the entries row
        data = app.getGridEntries("g1")
        app.addGridRow("g1", data)

MatPlotLib


Support for embedding very basic MatPlotLib plots.

Plot

from numpy import sin, pi, arange
from appJar import gui

x = arange(0.0, 3.0, 0.01)
y = sin(2*pi*x)

app = gui()
axes = app.addPlot("p1", x, y)
axes.legend(['key data'])
app.go()