[Pythonmac-SIG] mac event loop

Peter Sommerfeld peter.sommerfeld@gmx.de
Thu, 22 Oct 1998 00:17:57 +0200


For various reasons I've made my event loop from scratch an do not use
FrameWork.py. As expected I've got some problems :)

(1) I would like to override the std zoom in / zoom out behavior for
something like a full screen mode. According to "Inside Macintosh" I have to
change the stdState of the WStateData structure in the dataHandle field of
the window record. 

in PASCAL: (Toolbox Essentials 4-55)

    WSTateDataHandle(WindowPeek(thisWindow)^.dataHandle)^^stdState :=
zoomRect 

Can that be done in python and if so, how ? If not I can use SizeWindow()
with an flag but I prefer to avoid that way.

(2) The multiple event loop problem bites me too :). I normally use JvR's
IDE and have to update it's windows manually after running my application.
This is annoying on the long run. May be I could check for the wid attribute
of the frontmost window like FrameWork.py but I understood that there are
other loops/windows too. Is there or will be there a generalized way to
handle this ?

(3) I (presently) don't think that my application will need multi threading.
Is there a need to implement async events anyway ? (I dont have any clue
about multi threading on Mac/Python up to now :)

(4) My last point is a suggestion. It is recommended by Apple to use
menuID's from 1 to 235 for application *submenus* and each other number >
128 for menus (Toolbox Essentials 3-44). When I used 1 I got a conflict with
the IDE or python-out. I didn't check submenus up to now but I think there
is a need for two funktions like

GetMenuID()    -> menuID
GetSubMenuID() -> submenuID


Comments, ideas, suggestions ?

thanks

Peter

PS: Thanks a lot to JvR for his great IDE !  I can hardly imagine to do all
that work without it. I don't use the debugger often (because print is
really easy to use in python) but *IF* I use it, it is really needed !