View Single Post
TrueJournals's Avatar
Posts: 480 | Thanked: 378 times | Joined on Apr 2008 @ Chicago-ish
#3
Not going to write any test code, so I haven't tried this at all... First I think you'll need to test for whether it's a ScrolledWindow or FingerScroll... For a ScrolledWindow, use gethadjustment(), then set the value of the returned gtk.Adjustment to some increment above or below its current value, then use sethadjustment() on the ScrolledWindow.

I hope that made sense. Not sure about the FingerScroll.

[edit]Here's some mostly-code:
Code:
if event.keyval == (UP keysym):
    if type(self.sw) == type(gtk.ScrolledWindow()):
        adj = self.sw.get_vadjustment()
        val = adj.get_value()
        adj.set_value(val+(adjustment))
        self.sw.set_vadjustment(adj) # Not sure if this is necessary
    elif type(self.sw) == type(mokoui.FingerScroll()):
        pass
        #Not sure about this
Obviously, this leaves about some values, and I haven't looked into mokoui.FingerScrol. You would also want to test that mokoui is imported before you just call type(mokoui.FingerScroll())

[edit2]Looking at mokoui... I believe the code would be the same as the scrolledwindow code, so no need to type test. Again, I haven't tried this at all (I've never even dealt with mokoui before).
__________________
Disclaimer: If a program I wrote doesn't work/breaks your tablet... It's not my fault
mcedit | Utility Calculators (WIP) | PyRDesktop
My Blog | Twitter

Last edited by TrueJournals; 2009-04-04 at 23:53.
 

The Following User Says Thank You to TrueJournals For This Useful Post: