View Single Post
thp's Avatar
Posts: 1,391 | Thanked: 4,272 times | Joined on Sep 2007 @ Vienna, Austria
#1
If you're developing a app that can profit from a finger-scrollable view in GTK+/C or PyGTK/Python, you can now use libmokoui2 and its Python bindings (python-mokoui) from Diablo Extras (modified the Ubuntu source package to build for Maemo).

mokoui's FingerScroll widget even has the rubberband effect at the end of the list - very cool!

mokoui.FingerScroll can be used as a drop-in replacement for gtk.ScrolledWindow. Here's a small example in Python/PyGTK to get you started:

Code:
import gtk
import mokoui

mokoscroll = mokoui.FingerScroll()
# uncomment the following for "rotating" scroll mode
#mokoscroll.set_property('mode', 1)

treeview = gtk.TreeView()
model = gtk.ListStore(str)
for i in range(100):
    model.append([str(i)])
treeview.set_model(model)

column = gtk.TreeViewColumn('Blubb', gtk.CellRendererText(), text=0)
treeview.append_column(column)

w = gtk.Window()
w.connect('destroy', gtk.main_quit)
mokoscroll.add(treeview)
w.add(mokoscroll)
w.show_all()

gtk.main()
 

The Following 7 Users Say Thank You to thp For This Useful Post: