aboutsummaryrefslogtreecommitdiffstats
path: root/src/__main__.py
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-02-27 09:17:10 +0100
committerMattias Andrée <maandree@operamail.com>2014-02-27 09:17:10 +0100
commitb952f346b10cec28284bf18a64990d914236e41e (patch)
tree6180030258afa255ec208e1b978b16cc44827c37 /src/__main__.py
parentadd Bar class (diff)
downloadxpybar-b952f346b10cec28284bf18a64990d914236e41e.tar.gz
xpybar-b952f346b10cec28284bf18a64990d914236e41e.tar.bz2
xpybar-b952f346b10cec28284bf18a64990d914236e41e.tar.xz
add Bar.clear
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/__main__.py')
-rwxr-xr-xsrc/__main__.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/__main__.py b/src/__main__.py
index dab6c49..55b5fe8 100755
--- a/src/__main__.py
+++ b/src/__main__.py
@@ -143,6 +143,15 @@ class Bar:
@param font The font
'''
self.gc.change(font = font)
+
+ def clear(self):
+ '''
+ Fill the panel with its background colour and reset the colour and font
+ '''
+ self.change_colour(self.background)
+ self.window.fill_rectangle(self.gc, 0, 0, self.width, self.panel_height)
+ self.change_colour(self.foreground)
+ self.change_font(self.font)
open_x()
@@ -159,10 +168,7 @@ while True:
break
except KeyboardInterrupt:
break
- bar.change_colour(bar.background)
- bar.window.fill_rectangle(bar.gc, 0, 0, bar.width, bar.panel_height)
- bar.change_colour(bar.foreground)
- bar.change_font(bar.font)
+ bar.clear()
bar.draw_text(0, 10, '°°° TEST °°°')
display.flush()