Annotated edit history of
NiCallBackExample version 2, including all changes.
View license author blame.
| Rev |
Author |
# |
Line |
| 2 |
WikiAdmin |
1 |
Example: |
| |
|
2 |
|
| |
|
3 |
class !MainLoop: |
| 1 |
PerryLorier |
4 |
def callback() |
| |
|
5 |
|
| 2 |
WikiAdmin |
6 |
def main(self,[[string] argv): |
| 1 |
PerryLorier |
7 |
Event x=Event() |
| |
|
8 |
|
| |
|
9 |
self.callback() |
| |
|
10 |
|
| |
|
11 |
def registerCallBack(self,def callback()): |
| |
|
12 |
self.callback=callback |
| |
|
13 |
|
| |
|
14 |
class Event: |
| 2 |
WikiAdmin |
15 |
def __init__(self,!MainLoop main): |
| 1 |
PerryLorier |
16 |
main.registerCallback(self.callback) |
| |
|
17 |
|
| |
|
18 |
def callback(self): |
| |
|
19 |
stdio.print("Hello World") |