Active Topics

 


Reply
Thread Tools
laasonen's Avatar
Posts: 565 | Thanked: 618 times | Joined on Jun 2010 @ Finland
#1
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!
 
Posts: 432 | Thanked: 645 times | Joined on Mar 2009
#2
Hi,

have you seen this tutorial? Maybe it helps you.

Daniel
 
laasonen's Avatar
Posts: 565 | Thanked: 618 times | Joined on Jun 2010 @ Finland
#3
Originally Posted by danielwilms View Post
Hi,

have you seen this tutorial? Maybe it helps you.

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


 
Forum Jump


All times are GMT. The time now is 07:08.