aboutsummaryrefslogblamecommitdiffstats
path: root/xpybar/config/myscroll.py
blob: c5ef80713388137ee79753ab118ec7697d5a57df (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                                                                        
# -*- python -*-
from common import *

class MyScroll(Entry):
    def function(self):
        return '↓↑'
    
    def action(self, col, button, x, y):
        if button in (LEFT_BUTTON, RIGHT_BUTTON, SCROLL_UP, SCROLL_DOWN):
            G.groupi = (G.groupi + (+1 if button in (LEFT_BUTTON, SCROLL_DOWN) else -1)) % len(G.groups)
            G.group = G.groups[G.groupi]
            self.invalidate()