Active Topics

 


Reply
Thread Tools
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:
Khertan's Avatar
Posts: 1,012 | Thanked: 817 times | Joined on Jul 2007 @ France
#2
 
Khertan's Avatar
Posts: 1,012 | Thanked: 817 times | Joined on Jul 2007 @ France
#3
Hi !

I ve just a sad implementation on mCalendar ... and this slow ... really slow too much to be useable.



I ve try it also on a fixed height TreeView with only one column for mnotes. And after first bad feeling ... i can say it can be use for simple treeview.

Maybe it can be optimized a bit ?
But anyway keep this good work. I ll use it for the next release of mCalendar. I like the fact that this is a gtk widget !

oh and this slow also with a treeview containing photo.
 
Posts: 113 | Thanked: 13 times | Joined on Nov 2008 @ Darmstadt, Germany
#4
I'll definitely give it a try. Is there some kind of API-documentation for it?
 
Khertan's Avatar
Posts: 1,012 | Thanked: 817 times | Joined on Jul 2007 @ France
#5
 
bongo's Avatar
Posts: 291 | Thanked: 124 times | Joined on Feb 2006 @ Trier, Germany
#6
I like this widget ...
but how can I disable the rubberband effect?
__________________
ongo bongo!
 
Posts: 16 | Thanked: 1 time | Joined on Nov 2008
#7
Any screenshots/videos?
 
thp's Avatar
Posts: 1,391 | Thanked: 4,272 times | Joined on Sep 2007 @ Vienna, Austria
#8
Originally Posted by yukky View Post
Any screenshots/videos?
See this post for a demo video of my first experimental usage of this in gPodder:

http://www.internettablettalk.com/fo...&postcount=179

Originally Posted by bongo View Post
I like this widget ...
but how can I disable the rubberband effect?
I don't think this is possible. At least the docs don't say anything specific. Maybe you have to dig into the C code and write a patch and submit it upstream?

Originally Posted by branitar View Post
I'll definitely give it a try. Is there some kind of API-documentation for it?
http://docs.openmoko.org/references/...eference/html/ (the C library)

Or "pydoc mokoui" for the Python-ish documentation of the widgets. As usual, the Python API is analog to the C API, just like with PyGTK/PyCairo, etc..
 

The Following User Says Thank You to thp For This Useful Post:
Posts: 113 | Thanked: 13 times | Joined on Nov 2008 @ Darmstadt, Germany
#9
Originally Posted by thp View Post
http://docs.openmoko.org/references/...eference/html/ (the C library)

Or "pydoc mokoui" for the Python-ish documentation of the widgets. As usual, the Python API is analog to the C API, just like with PyGTK/PyCairo, etc..
That's what I was looking for, thanks! "pydoc mokoui" would have worked if i actually had installed it, but I wanted to have a look at the API first before doing so.
 
Khertan's Avatar
Posts: 1,012 | Thanked: 817 times | Joined on Jul 2007 @ France
#10
if you have ipython installed you can also do :

$ipython
import mokoui
help(mokoui)
 
Reply

Tags
finger, gtk, python, scroll, widget


 
Forum Jump


All times are GMT. The time now is 09:14.