Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Util/KeyboardWindow.py
diff options
context:
space:
mode:
authorNat <natcl@hotmail.com>2007-06-27 17:38:05 (GMT)
committer Nat <natcl@hotmail.com>2007-06-27 17:38:05 (GMT)
commit1a360aa3235c5b661f8eff0f9b57de4816e73d68 (patch)
tree81acb12732595d1600800a3dcf6113e4f1125f02 /Util/KeyboardWindow.py
parentaa880649800230cca3582c9499ad46c40faf7217 (diff)
Keyb size
Diffstat (limited to 'Util/KeyboardWindow.py')
-rw-r--r--Util/KeyboardWindow.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/Util/KeyboardWindow.py b/Util/KeyboardWindow.py
index 0946332..e9f00ea 100644
--- a/Util/KeyboardWindow.py
+++ b/Util/KeyboardWindow.py
@@ -6,18 +6,22 @@ import random
from ThemeWidgets import keyButton
class KeyboardWindow(gtk.Window):
- def __init__(self):
+ def __init__(self, size = None):
gtk.Window.__init__(self , gtk.WINDOW_TOPLEVEL)
self.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG)
color = gtk.gdk.color_parse("#000000")
self.modify_bg(gtk.STATE_NORMAL, color)
- self.connect("destroy",gtk.main_quit)
+ self.connect("destroy",self.hide)
self.connect("key-press-event",self.handle_keypress)
self.connect("key-release-event",self.handle_keyrelease)
- self.PIXEL_SPACE = 15
- self.HEIGHT = 45
+ if size == None:
+ self.PIXEL_SPACE = 15
+ self.HEIGHT = 45
+ else:
+ self.PIXEL_SPACE = size
+ self.HEIGHT = 3* size
self.rows = {}
self.rows[1] = [(49,1), (10,3), (11,3), (12,3), (13,3), (14,3), (15,3), (16,3), (17,3), (18,3), (19,3), (20,3), (21,5)]
@@ -72,7 +76,6 @@ class KeyboardWindow(gtk.Window):
self.add(mainhbox)
def handle_keypress(self,widget,event):
- print "allo"
self.btn_dic[event.hardware_keycode].set_fillcolor(random.random(),random.random(),random.random())
def handle_keyrelease(self,widget,event):
@@ -88,5 +91,6 @@ class KeyboardWindow(gtk.Window):
if __name__ == "__main__":
win = KeyboardWindow()
+ win.connect("destroy",gtk.main_quit)
win.show_all()
gtk.main() \ No newline at end of file