1 |
from adonthell import gfx, input, main |
from adonthell import gfx, input, main |
2 |
import sys, time |
import sys, time |
3 |
|
|
4 |
class InputtestApp: |
class InputtestApp (main.AdonthellApp): |
5 |
def __init__ (self, app): |
def __init__ (self): |
6 |
|
main.AdonthellApp.__init__(self) |
7 |
self.Letsexit = 0 |
self.Letsexit = 0 |
|
self.App = app |
|
8 |
|
|
9 |
## Callback fonction to handle keyboard events. |
## Callback fonction to handle keyboard events. |
10 |
## It will be passed a keyboard_event as a parameter |
## It will be passed a keyboard_event as a parameter |
31 |
|
|
32 |
def main (self): |
def main (self): |
33 |
## Initialize the gfx and input systems |
## Initialize the gfx and input systems |
34 |
self.App.init_modules (main.app.GFX | main.app.INPUT) |
self.init_modules (main.app.GFX | main.app.INPUT) |
35 |
|
|
36 |
## Set us a nice window |
## Set us a nice window |
37 |
gfx.screen.set_video_mode(640, 480) |
gfx.screen.set_video_mode(640, 480) |
55 |
return 0 |
return 0 |
56 |
|
|
57 |
if __name__ == '__main__': |
if __name__ == '__main__': |
58 |
myApp = main.AdonthellApp () |
app = InputtestApp () |
59 |
inputtest = InputtestApp (myApp) |
app.init (app.main) |
|
myApp.init (inputtest.main) |
|
60 |
|
|