Create A Basic Window
from appJar import gui
app = gui()
app.setSize(400,400)
app.setFont(16)
app.addLabel("Example")
app.go()
Button
from appJar import gui
app = gui()
app.setSize(400,400)
app.setFont(16)
def pressA():
app.addLabel("Pressed A")
app.addButton("A", pressA)
app.go()
app.addButton([title], [action when button is pressed])
before
after
Subwindows
from appJar import gui
app = gui()
app.setSize(400,400)
app.setFont(16)
def pressA():
app.startSubWindow("newWindow",title="This is a new winodw")
app.go(startWindow="newWindow")
app.addButton("A", pressA)
app.go()
after pressing the button A
Table & Pop out info box
from appJar import gui
app = gui()
app.setSize(400,400)
app.setFont(16)
def press(rowNumber):
app.infoBox("infoBox", "My number is %d"%(rowNumber))
app.addTable("tableName",
[["Table Title"],
["0"],
["1"],
["2"],
["3"]], action=press, actionButton="ButtonName", actionHeading="press me")#when action is set to a specific function, it will pass the row number to such function
app.go()
Row number starting from 0
Text Extry
from appJar import gui
app = gui()
app.setSize(400,400)
app.setFont(16)
def press():
app.infoBox("infoBoxTitle","The fist one said: %s; the second on said: %s" % (app.getEntry("JustAnEntry"), app.getEntry("NamedEntry")))
app.addEntry("JustAnEntry")
app.addLabelEntry("NamedEntry")
app.addButton("Get Content From Entries", press)
app.go()
No comments:
Post a Comment