NSSavePanel called from BSD application - no keyboard input
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