|
From: <tim...@en...> - 2006-10-26 22:02:24
|
Joe Koski wrote: > on 10/25/06 11:28 AM, Timoth=E9e Lecomte at tim...@en... wro= te: > > =20 >> <...> >>> Then I went back and rebuilt gnuplot-4.2.rc1, including wxt, with the= new >>> pango and cairo. The wxt plot window again appears with gnuplot, but = I still >>> can't get focus inside the plot window. I do see Mac fonts, however. = The >>> cursor behavior has changed. When the plot appears, my arrow cursor c= hanges >>> to crosshairs similar to X11, which is a step forward. When I place t= he >>> crosshairs over the plot window, the cursor changes to a spinning col= or >>> pinwheel. If I click back to the finder, I get my arrow cursor back. >>> >>> I'm with Per. I'm surprised that the wxWidget folks don't have a way = of >>> getting focus without bundling. Should I post the question there? >>> =20 >>> =20 >> It doesn't seem to be a rare question, since the wxWidgets wiki is qui= te >> lengthy about it. We should have looked at it earlier. Below are a >> couple of interesting links: >> >> http://www.wxwidgets.org/wiki/index.php/App_Not_Getting_Input_When_Run >> >> "You _must_ create a bundle for Carbon and Cocoa apps on OS X. >> >> If your binary is named "foo" then this works for testing purposes >> (don't ship like this): mkdir -p foo.app/Contents/MacOS mv foo >> foo.app/Contents/MacOS >> >> When you get things working you can eventually tweak your build system >> to make the bundle before the final link step and pass -o >> foo.app/Contents/MacOS/foo to the linker rather than plain -o foo." >> >> Some more details: >> http://www.wxwidgets.org/wiki/index.php/Distributing_WxWidgets_Applica= tions-Di >> stributing_WxMac_Programs >> http://www.wxwidgets.org/wiki/index.php/Installing_WxMac#Executables_.= 28.27Bun >> dles.27.29 >> http://www.wxwidgets.org/wiki/index.php/WxMac_Issues#Building_a_MacOSX= _applica >> tion_bundle >> >> Could you try the mkdir suggestion above ? (Don't use my second patch, >> it should be useless.) It seems quite straightforward. >> >> >> I also asked on irc again, and was redirected to the following page: >> http://wxforum.shadonet.com/viewtopic.php?t=3D9146 >> >> The alternative to "bundling" is the "resource fork", that can be done= with: >> >> /Developer/Tools/Rez -d __DARWIN__ -t APPL -d __WXMAC__ -i >> <insert_app_name> -d WXUSINGDLL -o <insert_app_name> Carbon.r >> >> where <insert_app_name> is the name of the executable (gnuplot here). = On >> http://wxforum.shadonet.com/viewtopic.php?t=3D6045&highlight=3Dmacos, = it is >> said that this is only for test purposes. >> >> >> I hope you'll finally get it working ! >> >> Best regards, >> >> Timoth=E9e >> >> =20 > Timoth=E9e, Per, > > I tried both approaches to resolve the focus problem with my gnuplot bi= nary, > but the problem persists. Thanks to Timoth=E9e for finding the links th= at > clearly state the problem, and also state the solutions. > > First I tried making a simple gnuplot.app structure like the one in the= web > page > > http://www.wxwidgets.org/wiki/index.php/App_Not_Getting_Input_When_Ru= n > > but, if you try to execute gnuplot, it probably needs to launch a termi= nal > application like iTerm.app, then gnuplot via a script so you can commun= icate > with the gnuplot. (I think that's what Per was hinting to me a year or = more > back when he suggested iTerm.app, while we were trying to figure out ho= w to > bundle octave). When I double-clicked gnuplot.app, the hard disk made a > noise, but nothing happened. > =20 I have two things to say about that: First, it looks like you can use the "open" command to start the bundled=20 application from the command line. Since gnuplot is a command-line=20 application, it may help. ('open gnuplot.app' or 'open -b gnuplot.app'=20 may do the trick) Second, what is said on the above page may not be enough. From another=20 discussion on irc and reading of the other pages I mentioned, it looks=20 like you also need a file called gnuplot.app/Contents/Info.plist that=20 describes the content of the bundle. Below is an example adapted from=20 http://www.wxwidgets.org/wiki/index.php/Mac_OS_X_And_Xcode_For_Beginners = : <?xml version=3D"1.0" encoding=3D"UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www= .apple.com/DTDs/PropertyList-1.0.dtd"> <plist version=3D"1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleExecutable</key> <string>gnuplot</string> <key>CFBundleGetInfoString</key> <string>gnuplot 4.2, (c) 2006 Thomas Williams and others</string> <key>CFBundleIconFile</key> <string>wxmac.icns</string> <key>CFBundleIdentifier</key> <string>org.gnuplot.app</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleLongVersionString</key> <string>4.2, (c) 2006 Code::gnuplot</string> <key>CFBundleName</key> <string>gnuplot</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>4.2</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>4.2</string> <key>LSRequiresCarbon</key> <true/> <key>NSHumanReadableCopyright</key> <string>Copyright 2006 me</string> </dict> </plist> > Then I tried the Rez incantation > > jakoski$ /Developer/Tools/Rez -d __DARWIN__ -t APPL -d __WXMAC__ -i gnu= plot > -d WXUSINGDLL -o gnuplot Carbon.r > > and, indeed, something happened to gnuplot, as there was a delay of a s= econd > or two at the command line while the hard disk made noise, and no error= s > were reported. When I tried the resulting Rez modified binary, it worke= d, > but the focus problem remained. I'm sorry, but I can't help here. > Do we need a separate wxt.app, or is that > called AquaTerm? > =20 No, the wxt terminal is built inside the gnuplot executable. There is=20 nothing more than the gnuplot executable and the other libraries that=20 you compiled before, and I guess those are loaded at run-time and don't=20 need to be in the bundle or anything. > Unless we can get the Rez modification to work, there are some importan= t > implications for gnuplot here, and I think Per can give us some insight > based on his experience with gnuplot and AquaTerm. > > If I am interpreting this correctly, the only sensible way to distribut= e > gnuplot-4.2 for Macs, with the wxt terminal included, is via a bundled > application. This is great for the end user (easy installation), but > requires significantly more work on the Mac development end to pull thi= ngs > together. > =20 Ultimately, it will be a matter of a makefile, nothing extraordinary. We=20 just need to get it working by hand first ;) I'm sorry not to have a Mac=20 to help more here. Best regards, Timoth=E9e |