• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: cross-platform problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cross-platform problem


  • Subject: Re: cross-platform problem
  • From: Laurence Harris <email@hidden>
  • Date: Sat, 17 Nov 2007 16:33:58 -0500


On Nov 17, 2007, at 5:20 AM, Bengt Nilsson wrote:

Hi!

I am trying to use the Qt cross-platform framework (www.trolltech.com) to build aplications for Windows and OSX, and possibly Linux.
One problem with this is that Windows (and Linux?) is using main (argc, argv[]) to pass the result of dropping-on-app or document double-click to the application to open the documents, while OSX does not.
Please correct me if I am wrong.
So document double-click or drop-on-app just launches the OSX application, but does not open any documents.
Again, please correct me if I have missed something.


I have tried to use an applescript "droplet" to collect the drop input list and then pass this to the application, and this actually works.
However, I do not know how to set this up correctly when combining the droplet executable and the Qt executable into the same bundle.
I want to set the path to the Qt app in the droplet script so that it finds it properly.


Here is a script that works, but it is of course useless because of the absolute path I used for testing:

on idle
(* Add any idle time processing here. *)
set j51command to "/Users/bnilsson/Programming/Qt/J51Viewer/build/ Debug/J51Viewer.app/Contents/MacOS/J51Viewer"
do shell script j51command
quit
end idle


on open names
(* Add your script to process the names here. *)
set j51command to "/Users/bnilsson/Programming/Qt/J51Viewer/build/ Debug/J51Viewer.app/Contents/MacOS/J51Viewer " & POSIX path of names
do shell script j51command
-- Remove the following line if you want the application to stay open.
quit
end open


Any comments or suggestions?

Yes. Read more about developing Mac software before trying to write Mac software. You're using a shell script to do something Macs were doing long before you could run shell scripts on them. Look at some of Apple's sample applications. Many of them handle files that are dragged to their icons.


And I'm pretty sure this a programming question, not an Xcode question, so carbon-dev or cocoa-dev would be a more appropriate place for these kinds of questions. Actually, this sounds like a Qt question. Opening a file by dragging it to an application is a common practice on a Mac, so I'd be surprised if Qt didn't supply a way to do this that you just need to hook into somehow. Someone on carbon- dev may know, although most of us on that list haven't used Qt.

Larry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: cross-platform problem
      • From: Bengt Nilsson <email@hidden>
References: 
 >cross-platform problem (From: Bengt Nilsson <email@hidden>)

  • Prev by Date: Re: Carbon question...
  • Next by Date: Re: cross-platform problem
  • Previous by thread: Re: Carbon question...
  • Next by thread: Re: cross-platform problem
  • Index(es):
    • Date
    • Thread