| Python 2.2 für Einsteiger | ||
|---|---|---|
| <<< Previous | Einführung anhand von Beispielen | Next >>> |
#!/usr/bin/python
import pyui
def onbutton(self):
"Callback function for when the button is pressed"
print "got a button "
def run():
done = 1
# Initialize everything
pyui.init(800,600)
# Create a window object
w = pyui.widgets.Frame(50, 50, 400, 400, "clipme")
# Create some widgets
pic = pyui.widgets.Picture( "hongkong.jpg")
pic.resize(100,100)
b = pyui.widgets.Button( "A button is here", onbutton)
# setup the widgets in the window
w.addChild(pic)
w.addChild(b)
w.pack()
# go into a loop to run the app
while done:
pyui.draw()
done = pyui.update()
#Done!
pyui.quit()
| <<< Previous | Home | Next >>> |
| Thread - Kontrolle | Up | Funktionales Programmieren - Produkt |