laasonen |
2010-08-18 07:15 |
Images to TouchSelector in python
I would like to put flags to my translator software's language list, but I'm not too good with gtk :(
There is what I managed to do:
Code:
#Librarys
import gtk
import hildon
import gobject
#Create window
window = hildon.StackableWindow()
#Create selector
selector = hildon.TouchSelector()
icon_list = gtk.stock_list_ids()
store_icons = gtk.ListStore(gobject.TYPE_STRING, gtk.gdk.Pixbuf)
new_iter = store_icons.append()
store_icons.set(new_iter, 0, ["English", gtk.gdk.pixbuf_new_from_file('flags/ENG.png')])
renderer = gtk.CellRendererPixbuf()
renderer.set_fixed_size(-1, 100)
column = selector.append_column(store_icons, renderer, stock_id = 0)
column.set_property("text-column", 0)
window.add(selector)
#Draw window
window.connect("destroy", gtk.main_quit)
window.show_all()
gtk.main()
Thanks!
|