maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Images to TouchSelector in python (https://talk.maemo.org/showthread.php?t=60575)

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!

danielwilms 2010-08-18 12:58

Re: Images to TouchSelector in python
 
Hi,

have you seen this tutorial? Maybe it helps you.

Daniel

laasonen 2010-08-19 09:12

Re: Images to TouchSelector in python
 
Quote:

Originally Posted by danielwilms (Post 790434)
Hi,

have you seen this tutorial? Maybe it helps you.

Daniel

I can't manage to replace those stock icons with images.


All times are GMT. The time now is 04:59.

vBulletin® Version 3.8.8