summaryrefslogtreecommitdiff
path: root/example/simple.py
blob: 9df226b2d2463935096651b77c05873c583b6cd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import gem

class AppMessageEvent(gem.MessageEvent):
    def __init__(self,app):
        gem.MessageEvent.__init__(self)
        
        self.app = app
        self.window = app.windows[0]
        
    def process(self):
        
        # First call the super's process()
        gem.MessageEvent.process(self)
        
        if self.message == WM_CLOSED:
            app.event_processing = False

def start_app():

    app = gem.Application()
    
    w = app.new_window((60,60,500,300))
    
    app.message_event = AppMessageEvent(app)
    
    app.event_loop()
    
    app.destroy()
    

if __name__ == "__main__":
    start_app()