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).
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
adj.set_page_increment(gtk.SCROLL_PAGES)