From: Jim I. <ji...@ap...> - 2002-01-03 00:32:47
|
On 1/2/02 12:35 PM, "Ashley Ward" <as...@dc...> wrote: > on 31/12/01 8:14 PM, Jim Ingham at ji...@ap... wrote: >>> 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 wind= ow, >>>>> 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 ha= ve >>>>> 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()). >>>>=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 >>> [...] >>> started it from. When I click in the app's window to bring it to the f= ront >>> in an attempt to use it, I get this message from tkMacOSXMouseEvent.c:2= 41 >>> (the function TkMacOSXProcessMouseEvent) on stderr: >>>=20 >>> SetFrontProcess failed,-600 >>> [...] >>> 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 CV= S. >>> 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 gon= e >>> wrong, I'd appreciate it as building Tk myself might help in debugging = my >>> app. >>>=20 >> 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,=20 >=20 > I've just cd'd into my tk and tcl directories and done a 'cvs update', bu= t > CVS didn't seem to do anything (it just said "Updating" on every director= y > name). >=20 > I did "update to latest version" in Project Builder, and compiled TkLibra= ry > again, but still got the error: >=20 > ld: Undefined symbols: > _Tcl_MacOSXOpenBundleResources >=20 >> and, since there were changes to configure & Makefile.in, you need to >> rerun configure and rebuild. >=20 > I did 'clean active target' in Project Builder before compiling. >=20 > Hmmm... "rerun configure and rebuild"... is it possible to compile it > without using Project Builder now? I remember reading a post from Jim th= at > said the UNIX makefiles hadn't been done. Tk doesn't use Make & Configure, but Tcl does. What happened was that some routine was moved from Tk to Tcl, so you will need to rebuild both Tcl & Tk= . On the Tk side, you need to make sure you rerun configure, as well as the build stage. The Tcl Projects are a bit hacked up, and the clean doesn't really work, so you have to do this by hand. If you have the time, the simplest way is probably just blowing away your object directory, and then rerunning the Tcl mega-build target. >=20 >> Sorry for the trouble. >=20 > No problem -- think we're getting there :) >=20 >> There is a patch in the Tk sourceforge Patch Manager to move the >> SetupTkNotifier, and a bunch of other miscellaneous junk, into the TkpIn= it >> routine so that you don=B9t have to do anything but call Tk_Init, and you = will >> be done. I need to clean it up (the style is not kosher, the contents a= re >> great), and check it in. I am still on vacation, but I will get to this >> this weekend... >=20 > That sounds good. Don't work too hard, though :) Somebody else did most of the work on this one. But thanks... >=20 >> I need to chase down the SetFrontProcess thing. This call usually succe= eds, >> 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. >=20 > It always fails with my app. And as it fails, I can't give the app focus > and so I can't interact with it. A fairly major problem :( I will see if I can think of some good diagnostics for you to insert... >=20 > Thanks for the reply. >=20 No problem... Jim --=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 |