#
#   Python GUI - Test application and menus
#

import GUI

class TestApp(GUI.Application):

    def __init__(self):
        GUI.Application.__init__(self)
        foo_menu = GUI.Menu("Foo",
            ("Blarg/B", 'blarg_cmd')
        )
        self.menus += [foo_menu]
        
    def setup_menus(self, m):
        GUI.Application.setup_menus(self, m)
        m.blarg_cmd.enabled = 1
    
    def blarg_cmd(self):
        print "Blarg!"
    
    def key_down(self, event):
        print "Key down:", event
    
    def key_up(self, event):
        print "Key up:", event
    
    def auto_key(self, event):
        print "Auto key:", event

app = TestApp()

if not app.zero_windows_allowed():
    win = GUI.Window(title = "TestApp")
    win.show()

app.run()
