[maemo-developers] N800 finger scrolling in gtk... and how to detect a stylus long-press...
From: Chris Lord chris at openedhand.comDate: Mon Jun 16 12:15:06 EEST 2008
- Previous message: N800 finger scrolling in gtk... and how to detect a stylus long-press...
- Next message: maemo-developers Digest, Vol 38, Issue 15
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi David, I wrote a widget for OpenMoko that replaces GtkScrolledWindow, with very similar API, that allows you to do finger-scrolling instead of scroll-bar scrolling - The SVN repository is at http://svn.openmoko.org/trunk/src/target/OM-2007.2/libraries/libmokoui2/ and you can find debian packaging at https://edge.launchpad.net/~cwiiis/+archive , although I'll warn you that that's a bit out of date and I think the Intel MID project have more recent packaging (they have collaborated with me and kept me informed on this, it's my fault that my own packaging is out-of-date). There are caveats with using this widget, as the GTK event system wasn't really designed with this interaction in mind. The widget works by intercepting mouse events and re-synthesising new events for the underlying widgets - This usually works fine, but certain things don't work, such as mouse-over (this is easy to fix, but was unnecessary given it's aimed at touch-screens) and double-clicking (harder to fix). You might also have some fun problems if you grab the cursor too. Hope that helps some - depending on your users, you may find that it's more efficient to write your own custom-purpose finger-scrolling widget. If you find that and you want some code to use as an example (and you don't find any better code than mine (which I'm sure there's a lot of ;)), I'd recommend you take a look at the finger-scrolling widget I've written for tidy - http://svn.o-hand.com/repos/tidy/trunk/tidy/tidy-finger-scroll.c - The code is much cleaner as clutter has a more advanced events system and I wrote it after having learnt a lot with MokoFingerScroll. Regards, --Chris On Sun, 2008-06-15 at 18:02 +0100, David Greaves wrote: > I'm still persevering with my C/gtk app and have a couple of questions. > > It was going to be 3 but I sorted out the > dbus/com.nokia.mce.request.req_led_pattern_activate one :) > > So, first: How do I get finger scrolling? > > I have a hildon program with a vbox and a list of my own widgets (composite hbox > with tick/label/entry). > > I'd like to be able to scroll using a finger rather than the stylus in the > scrollbar - any ideas? > > > Secondly: How do I detect a long stylus press? > A normal press will activate a tickbox (and eventually I'll see if I can get > this from the label or the hbox). > I'd like a long press to call an edit callback. > > David > > _______________________________________________ > maemo-developers mailing list > maemo-developers at maemo.org > https://lists.maemo.org/mailman/listinfo/maemo-developers
- Previous message: N800 finger scrolling in gtk... and how to detect a stylus long-press...
- Next message: maemo-developers Digest, Vol 38, Issue 15
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]