From c657af1562c294837b93904cb2625809b2f7ead3 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 27 Feb 2014 09:28:34 +0100 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/__main__.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src') 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() -- cgit v1.2.3-70-g09d2