2008年12月8日 星期一

Python on Freerunner

http://wiki.openmoko.org/wiki/Python
GTK

#!/usr/bin/python
import gtk

#create a (nonvisible) window
w = gtk.Window()

#create a button (not yet on any window)
b = gtk.Button('Hello')

#put the button on the window
w.add(b)

#create a silly callback function
def hello(target):
print 'Hello world'
exit()

#make the button call the callback when pressed
b.connect('clicked', hello)

#make the window display
w.show_all()

#start processing screen events
gtk.main()

http://www.pygtk.org/reference.html
http://www.pygtk.org/docs/pygtk/

http://wiki.openmoko.org/wiki/EFL_Documentation
etk examples
http://svn.enlightenment.org/svn/e/trunk/BINDINGS/python/python-etk/examples/
ETK
import etk

#create a button (not yet on any window)
b = etk.Button(label="Hello")

#create a (nonvisible) window and put the button on the window
w = etk.Window(title="Hello", child=b)

#create a silly callback function
def hello(target):
print 'Hello World'
etk.main_quit()

#make the button call the callback when pressed
b.on_clicked(hello)

#make the window display
w.show_all()

#start processing screen events
etk.main()

沒有留言: