1 # Function to display a message and wait for the user to hit OK.
2 # This uses a DLOG resource with ID=256 which is part of the standard
4 # The ID can be overridden by passing a second parameter.
5 # This is the modeless version of this test program, the normal
6 # modal version is in tdlg.py
16 def message(str = "Hello, modeless world!", id = ID
):
17 print 'This is to init the console window...'
18 d
= GetNewDialog(id, -1)
19 tp
, h
, rect
= d
.GetDialogItem(2)
20 SetDialogItemText(h
, str)
22 ok
, ev
= WaitNextEvent(0xffff, 10)
26 ok
, window
, item
= DialogSelect(ev
)
32 print 'Unexpected item hit'
34 print 'Unexpected dialog hit'
41 if __name__
== '__main__':