gtk: don't use gtk if there's no display
[urk.git] / script.py
blobc0bd180f930e9bf8905a985b1d64d6fb2b249d80
1 import events
3 def onCommand(e):
4 if e.name == "flag":
5 e.done = True
7 events.run_command("say - %s" % e.switches, e.window, e.window.network)
9 def onRightClick(e):
10 def print_blah():
11 print "blah"
13 e.menu.append(("RightClick", print_blah))
15 def onListRightClick(e):
16 def print_blah():
17 print "blah"
19 e.menu.append(("ListRightClick", print_blah))
21 def onWindowMenu(e):
22 def print_blah():
23 print "blah"
25 e.menu.append(("WindowMenu", print_blah))
27 def defCommand(e):
28 if not e.done:
29 if 'handle_%s' % e.name in globals():
30 globals()['handle_%s' % e.name](e)