From: Ashley W. <ash...@nt...> - 2002-01-21 15:54:27
|
>on 10/1/02 1:47 AM, Jim Ingham at ji...@ap... wrote: >> On 1/9/02 9:07 AM, "Ashley Ward" <ash...@nt...> wrote: >> linking my application with them. (By the way: can anyone tell me the >> equivalent of 'ldd' on Mac OS X so I can check this?). > > otool -L > > Is what you want, I think. > >> I still get the SetFrontProcess error, every time I try to give my app >> focus. > > Are you building your app as an app package (I may have asked this before, I > forget). There are problems with getting the WindowServer to recognize you > if you are not wrapped in a proper App package. It is easy to get PB to do > this for you. You don't even need to use PB to build your App. If you are > already using a Makefile, then make one target that is a "Legacy Makefile > Target" that builds your App, and an App target that builds the App package, > and copies the binary into the correct place in the package. Ah -- yup, thanks -- that was it. My app now runs :) :), but I've got a bunch of minor bugs, which I'll describe below. First, though, I'm trying to figure out how to make the Application package portable from machine to machine, even if the Tcl/Tk Frameworks are not installed on the machine. To do this, I think I need to include the Tcl and Tk Frameworks in my application bundle in Contents/Frameworks or perhaps even Contents/SharedFrameworks. However, I can't even convince the linker to link with the Tcl/Tk Frameworks that I've compiled up from CVS (in /Users/ashley/TclTkCVS/tcl and tk). My link line currently looks like this: cc -o tkeden Eden/libeden.a Misc/libmisc.a Donald/libdonald.a Sasami/libsasami.a EX/libex.a Scout/libscout.a /Users/ashley/TclTkCVS/tk/macosx/build/Tk.framework/Tk /Users/ashley/TclTkCVS/tk/macosx/build/Tcl.framework/Tcl /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundatio n /System/Library/Frameworks/Carbon.framework/Carbon nothing.c (I seem to need CoreFoundation and Carbon as I'm using a few CFBundle calls to get a reference to some library files in Contents/Resources, similar to the code in tkMacOSXAppInit.c). which succeeds, despite this warning: /usr/bin/ld: warning unused multiple definitions of symbol _matherr /Users/ashley/TclTkCVS/tk/macosx/build/Tcl.framework/Tcl(tclMtherr.o) definition of _matherr /usr/lib/libSystem.dylib(s_matherr.o) unused definition of _matherr ...but 'otool -L' shows that it has actually picked the Tcl/Tk Frameworks that I installed from the binary Wish package in /Library: [localhost:~/tkeden] ashley% otool -L tkeden tkeden: /Library/Frameworks/Tk.framework/Versions/8.4/Tk (compatibility version 8.4.0, current version 8.4.0) /Library/Frameworks/Tcl.framework/Versions/8.4/Tcl (compatibility version 8.4.0, current version 8.4.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundatio n (compatibility version 150.0.0, current version 227.2.0) /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 122.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 55.0.0) If I temporarily rename /Library/Frameworks to something else, my app then won't load. So: 1) How do I convince the linker to use the Frameworks I've specified? 2) (Presumably having achieved this...) How do I set the linker up to link with a Framework within the final application bundle? I'm using plain command line cc and make etc as I'd like to use the same build setup that I have on other platforms. In vain, last night I tried to get it into ProjectBuilder, but I can't even compile it there -- currently tk.h seems to be looking for a load of X and other stuff: /Users/ashley/TclTkCVS/tk/macosx/build/Tk.framework/Versions/8.4/Headers/tk. h:86: header file 'X11/Xlib.h' not found /Users/ashley/TclTkCVS/tk/macosx/build/Tk.framework/Versions/8.4/Headers/tk. h:561: undefined type, found `XEvent' /Users/ashley/TclTkCVS/tk/macosx/build/Tk.framework/Versions/8.4/Headers/tk. h:570: undefined type, found `Tk_ClassCreateProc' [etc etc] I've tried to look through all the docs I downloaded with the Developer Tools, but nothing seems to explain linker issues (and much of man ld goes over my head). Any hints would be appreciated! Also, I have a few bugs in my app which, now I've noticed them, seem to also occur in Wish, so I assume they are Tcl/Tk bugs. - Cut and paste from other applications doesn't work (it seems OK within the app). - In the scroll bar, the down button is only slightly visible: it is obscured by the window resize widget. - When dragging the title bar of a window in order to move it, it seems necessary to give it focus first. - 'Hide tkeden' (in the left most menu) doesn't work. Wish seems to die unexpectedly when this is chosen. - I have some menus with -tearoff set. This is implemented as a "(Tear-off)" menu option, which creates a torn off menu at the extreme top-left of the screen, with the first item behind the Apple menu bar :( - Maximise (+) button doesn't work. - The Aqua close / minimise / maximise buttons in the title bar don't show their x - + inners when the mouse is moved over them. Finally, the other bug which I could do with some help on (I have lots more, but I hope I can fix these myself!) is that the About option in the left most menu for my app is actually "About Tcl & Tk" and leads to that information. How do I override this to show my own About information? Many thanks for any 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 |