From: Tony L. <to...@me...> - 2001-10-22 23:54:32
|
> >Ah, I see. If you run this from the console, you will notice that >you get an error when you click to bring it to the foreground, which >looks like: > >SetFrontProcess failed,-600 > >-600 is supposed to mean "unrecognized drag recipient" but really >probably just means that we aren't registered as a real app with the >Window Server. You can do this either by having the appropriate >MacOS resource bits (kind, etc) or by being in an App package. I >bet you can even poke these bits in directly, but I don't know how. Yes, I get this exact message when running the a.out compiled from tkMacOSXAppInit.c, so that explains that, thanks. I'm not getting that behavior from Python+tkinter yet. So far it won't show a window until I either hit Ctrl-C (when invoking a non-.app python) or Force-Quit the app (when invoking Python.app). Then the window shows, and python exits. So, instead of the window showing without responding, no window shows until a Ctrl-C gets to it. But at least we know that for Tkinter to ever work, it must smell like a Mac OS X application and not a unix command line application. Jack, you mentioned that Python is not multi-threaded internally - which is true of course - but when you build Python with threads you get different code in Tkinter's mainloop function. So whether Python was configured with threads might make a difference. Without threads Tkinter's mainloop boils down to: while (!exception_occurred && Tk_GetNumMainWindows() > 0 > 0) { Tcl_DoOneEvent(0); } With threads Tkinter's mainloop boils down to: while (!exception_occurred && Tk_GetNumMainWindows() > 0) { Tcl_DoOneEvent(TCL_DONT_WAIT); let other python threads run while sleeping for a short time } Jim, if someone is trying to embed Tk/Aqua using a straightforward approach of using Tcl_AppInit() and Tk_Main(), what extra calls (beyond what's necessary in X11 Tcl/Tk) does one need to make? Everything in tkMacOSXAppInit? Or just Tk_MacOSXSetupTkNotifier()? -Tony -- |