• 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
NSSavePanel called from BSD application - no keyboard input
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSSavePanel called from BSD application - no keyboard input


  • Subject: NSSavePanel called from BSD application - no keyboard input
  • From: Kevin Martin <email@hidden>
  • Date: Mon, 9 Feb 2009 15:54:16 +0000

Hi,

I am pretty new to Cocoa and Objective C, so please forgive me if the answer is obvious. I have done a search of the archive and have found a few people experiencing the same problem - but no solution.

I have a console application that I want to be able to run on both Windows and OS X, The only real UI related task I have is to prompt for paths for loading and saving files. I really prefer a nice dialog to asking the user to enter a path on the console.

For the OS X version of the code I see that NSSavePanel and NSOpenPanel are what I'm after. I've written what I think is right, but I get no keyboard input - or rather it goes to the wrong place. I'm guessing this is because there is no NSApplication (and thus no message loop) set up, but this doesn't make complete sense to me as mouse events work fine. The input goes into the application I launched the my code from, either Terminal or XCode.

I have attached code that should allow you to replicate the problem. I can compile it with

g++ nsspprob.mm -framework cocoa

Also, the dialog does not automatically pop up in front of other windows. I would like it to do that as well.

Thanks,
Kevin Martin


Attachment: nsspprob.mm
Description: Binary data


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSSavePanel called from BSD application - no keyboard input
      • From: Michael Ash <email@hidden>
    • Re: NSSavePanel called from BSD application - no keyboard input
      • From: "Sean McBride" <email@hidden>
    • Re: NSSavePanel called from BSD application - no keyboard input
      • From: Kevin Martin <email@hidden>
  • Prev by Date: Why its necessary to include .dylib file to project as well as to /usr/local/lib?
  • Next by Date: RubyCocoa: IB do not read class files
  • Previous by thread: Re: Why its necessary to include .dylib file to project as well as to /usr/local/lib?
  • Next by thread: Re: NSSavePanel called from BSD application - no keyboard input
  • Index(es):
    • Date
    • Thread