So erstellen ich eine Bildlaufleiste in AppJar, um 10 Zahlen auf einmal (1-10, 11-20 usw.) anzuzeigen, und ich frage mich, was der beste Weg ist zu gehen darüber.Erstellen einer Bildlaufleiste (appJar)
Sollte ich eine Funktion erstellen, um die nächsten 10 Zahlen bis zum Scrollbalken (was eine Skala ist, obwohl dies die falsche Methode sein könnte) zu verbergen, und dann erscheinen sie?
Ich bin jetzt wirklich verloren, da ich erst seit ungefähr 2 Tagen für ein Projekt lernen, wie man appJar verwendet. Irgendwelche Ideen wären eine große Hilfe. Ja, das ist nur der GUI-Teil, und Python (3.6) wurde noch nicht hinzugefügt, wird es aber sein.
from appJar import gui
def press(btn):
if btn == "1":
app.setLabel("answer", "1!")
elif btn == "2":
app.setLabel("answer", "2!")
elif btn == "3":
app.setLabel("answer", "3!")
elif btn == "4":
app.setLabel("answer", "4!")
elif btn == "5":
app.setLabel("answer", "5!")
elif btn == "6":
app.setLabel("answer", "6!")
elif btn == "7":
app.setLabel("answer", "7!")
elif btn == "8":
app.setLabel("answer", "8!")
elif btn == "9":
app.setLabel("answer", "9!")
elif btn == "10":
app.setLabel("answer", "10!")
app.startScrollPane("scroller")
elif btn == "11":
app.setLabel("answer", "11!")
elif btn == "12":
app.setLabel("answer", "12!")
app.stopScrollPane("scroller")
app=gui()
app.setFont(20)
app.addButtons(["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"], press)
app.addScale("scroller")
app.setScaleChangeFunction("scroller", press)
app.setButton ("1", "1")
app.setButton ("2", "2")
app.setButton ("3", "3")
app.setButton ("4", "4")
app.setButton ("5", "5")
app.setButton ("6", "6")
app.setButton ("7", "7")
app.setButton ("8", "8")
app.setButton ("9", "9")
app.setButton ("10", "10")
app.setButton ("11", "11")
app.setButton ("12", "12")
app.addLabel ("answer", "Pick a Number!")
app.go()