aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xsrc/__main__.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/__main__.py b/src/__main__.py
index 38c5298..83d45f7 100755
--- a/src/__main__.py
+++ b/src/__main__.py
@@ -32,7 +32,8 @@ BACKGROUND, FOREGROUND = (0, 0, 0), (192, 192, 192)
def redraw():
'''
- Invoked when redraw is needed, feel free to replace it completely
+ Invoked when redraw is needed,
+ feel free to replace this completely
'''
global bar
bar.clear()
@@ -40,7 +41,7 @@ def redraw():
def start():
'''
Invoked when it is time to create panels and map them,
- feel free to replace it completely
+ feel free to replace this completely
'''
global bar
bar = Bar(OUTPUT, HEIGHT, YPOS, TOP, FONT, BACKGROUND, FOREGROUND)
@@ -49,11 +50,20 @@ def start():
def stop():
'''
Invoked when it is time to unmap the panels,
- feel free to replace it completely
+ feel free to replace this completely
'''
global bar
bar.unmap()
+def unhandled_event(e):
+ '''
+ Invoked when an unrecognised even is polled,
+ feel free to replace this completely
+
+ @param e The event
+ '''
+ pass
+
class Bar:
'''
@@ -133,6 +143,8 @@ class Bar:
'''
draw_text(bar.window, bar.gc, x, y, text)
+ # TODO add draw_colour_text
+
def create_colour(self, red, green, blue):
'''
Create a colour instance
@@ -195,6 +207,8 @@ while True:
e = display.next_event()
if e.type == Xlib.X.DestroyNotify:
break
+ else:
+ unhandled_event(e)
except KeyboardInterrupt:
break
redraw()