From: Ashley W. <ash...@nt...> - 2001-12-31 16:43:01
|
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 have >> copied a few likely-looking things into my Tcl_AppInit() and main(). In >> 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 then >> causes a similar but deeper hang earlier on (not in the call to >> Tk_MacOSXSetupTkNotifier()). > > I think you are not doing the call to Tk_MacOSXSetupTkNotifier early > enough. Call it before ALL other Tcl_* or Tk_* functions. > > -Tony Ah -- yes, thanks Tony. I thought I'd put this call early on in main(), but not early enough. 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 front in an attempt to use it, I get this message from tkMacOSXMouseEvent.c:241 (the function TkMacOSXProcessMouseEvent) on stderr: SetFrontProcess failed,-600 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 PSN used is obtained from a call to GetCurrentProcess a few lines before. The return code from GetCurrentProcess isn't checked, but I've called it manually with gdb and it seems to return 0. Any ideas why SetFrontProcess would fail in this way? 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. Many thanks for the help. Ash. -- Ashley Ward - Graduate Teaching Assistant - PhD student as...@dc... - http://www.dcs.warwick.ac.uk/~ashley/ Room 3.16, Department of Computer Science, University of Warwick, Coventry |