From: Jim I. <ji...@ap...> - 2001-12-31 20:14:33
|
Ashley, How recently have you updated your Tcl/Tk sources? I made some changes (moving the routine you aren't finding from Tk to Tcl, where it more properly belongs). But I forgot to check in one of the subdirectories, so the Makefiles didn't get updated. You need to update all the Tcl & Tk trees, and, since there were changes to configure & Makefile.in, you need t= o rerun configure and rebuild. Sorry for the trouble. There is a patch in the Tk sourceforge Patch Manager to move the SetupTkNotifier, and a bunch of other miscellaneous junk, into the TkpInit routine so that you don=B9t have to do anything but call Tk_Init, and you wil= l be done. I need to clean it up (the style is not kosher, the contents are great), and check it in. I am still on vacation, but I will get to this this weekend... I need to chase down the SetFrontProcess thing. This call usually succeeds= , but there is some glitch that causes it to occasionally fail. It doesn't seem to be harmful, however, so I haven't looked into it further. Jim > on 25/12/01 7:04 pm, Tony Lownds at to...@me... wrote: >> At 7:24 PM +0000 12/21/01, Ashley Ward wrote: >>> When I run my application, I now get a partially-drawn interface window= , but >>> then it hangs. I can use gdb to generate a backtrace: >>> [...] >>> I suspect that perhaps I'm getting the Tcl/Tk initialisation wrong. I'= ve >>> had a look at tkMacOSXAppInit.c from the macosx-8-4-branch on CVS and h= ave >>> copied a few likely-looking things into my Tcl_AppInit() and main(). I= n >>> particular, I've added TkMacOSXInitAppleEvents(interp); and >>> TkMacOSXInitMenus(interp); to Tcl_AppInit() (which doesn't seem to have= any >>> effect) and tried adding Tk_MacOSXSetupTkNotifier(); to main(), which t= hen >>> causes a similar but deeper hang earlier on (not in the call to >>> Tk_MacOSXSetupTkNotifier()). >>=20 >> I think you are not doing the call to Tk_MacOSXSetupTkNotifier early >> enough. Call it before ALL other Tcl_* or Tk_* functions. >>=20 >> -Tony >=20 > Ah -- yes, thanks Tony. I thought I'd put this call early on in main(), = but > not early enough. >=20 > My app now starts up with what seems to be a partially-drawn interface > window, as before. The app's window is behind the Terminal window which = I > started it from. When I click in the app's window to bring it to the fro= nt > in an attempt to use it, I get this message from tkMacOSXMouseEvent.c:241 > (the function TkMacOSXProcessMouseEvent) on stderr: >=20 > SetFrontProcess failed,-600 >=20 > I found some documentation in Project Builder (the Process Manager docs) > about this Carbon call, and apparently -600 means procNotFound: "Unknown > drag reference", so I'm guessing that perhaps the PSN is invalid? The PS= N > used is obtained from a call to GetCurrentProcess a few lines before. Th= e > return code from GetCurrentProcess isn't checked, but I've called it > manually with gdb and it seems to return 0. >=20 > Any ideas why SetFrontProcess would fail in this way? >=20 > Also I can't seem to compile Tcl or Tk from the code I obtained from CVS. > I'm using Project Builder, with the Wish.pbproj. Trying to compile the > TkLibrary target gives me an error when linking: "Undefined symbols: > _Tcl_MacOSXOpenBundleResources". Apologies -- it's probably a newbie > mistake with Project Builder. If anyone could point out where I've gone > wrong, I'd appreciate it as building Tk myself might help in debugging my > app. >=20 > Many thanks for the help. >=20 > Ash. --=20 ++=3D++=3D++=3D++=3D++=3D++=3D++=3D++=3D++=3D++=3D++=3D++=3D++=3D++=3D++=3D++=3D++=3D++=3D++=3D Jim Ingham ji...@ap... Developer Tools - gdb |