maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   mokoui2 + Python bindings now in Extras (finger scroll) (https://talk.maemo.org/showthread.php?t=25640)

thp 2008-12-17 13:14

mokoui2 + Python bindings now in Extras (finger scroll)
 
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()


Khertan 2008-12-17 15:04

Re: mokoui2 + Python bindings now in Extras (finger scroll)
 
Could be interesting ...

Khertan 2008-12-17 19:05

Re: mokoui2 + Python bindings now in Extras (finger scroll)
 
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.

branitar 2008-12-17 21:32

Re: mokoui2 + Python bindings now in Extras (finger scroll)
 
I'll definitely give it a try. Is there some kind of API-documentation for it?

Khertan 2008-12-17 22:06

Re: mokoui2 + Python bindings now in Extras (finger scroll)
 
The pydoc of course

bongo 2008-12-17 22:08

Re: mokoui2 + Python bindings now in Extras (finger scroll)
 
I like this widget ...
but how can I disable the rubberband effect?

yukky 2008-12-17 23:08

Re: mokoui2 + Python bindings now in Extras (finger scroll)
 
Any screenshots/videos?

thp 2008-12-18 12:19

Re: mokoui2 + Python bindings now in Extras (finger scroll)
 
Quote:

Originally Posted by yukky (Post 250434)
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

Quote:

Originally Posted by bongo (Post 250411)
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?

Quote:

Originally Posted by branitar (Post 250395)
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..

branitar 2008-12-18 13:16

Re: mokoui2 + Python bindings now in Extras (finger scroll)
 
Quote:

Originally Posted by thp (Post 250582)
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 2008-12-18 13:21

Re: mokoui2 + Python bindings now in Extras (finger scroll)
 
if you have ipython installed you can also do :

$ipython
import mokoui
help(mokoui)


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

vBulletin® Version 3.8.8