Hottest Free Downloads - DownloadPipe.com Over 197,000 downloads! Bookmark Now!
DownloadPipe.com - New Downloads Every Minute
 SEARCH:
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Question Regarding Key Windows

 
   Mac (Home) -> General Discussion RSS
Next:  NSData's +dataWithContentsOfFile  
Author Message
Mike Hofer

External


Since: Jul 04, 2005
Posts: 3



(Msg. 1) Posted: Sun Jul 03, 2005 2:41 am
Post subject: Question Regarding Key Windows
Archived from groups: comp>sys>mac>programmer>misc (more info?)

I am just learning Mac programming (coming over from .NET on Windows &
Web), and I was going through "Introduction to Developing Cocoa
Objective-C Applications: A Tutorial". In it, Apple says,
"Key windows respond to key presses for an application and are the
primary recipient of messages from menus and panels. Usually a window is made
key when the user clicks it. Each application can have only one key
window."
Now, I think I understand what this is saying, but I want to be sure. I
think that it means that an application can have multiple key windows,
but that only one of them is ever ACTIVE (receiving keystrokes) at a
given time. This would make sense to me. Otherwise, you'd only get one
application window that could receive keystrokes, and that's that.
Am I understanding this correctly?

Any help is greatly appreciated!
Back to top
Login to vote
Jøhnny_Fävòrítê

External


Since: Jun 27, 2005
Posts: 18



(Msg. 2) Posted: Sun Jul 03, 2005 3:37 am
Post subject: Re: Question Regarding Key Windows [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Mike Hofer wrote:
> "Key windows respond to key presses for an application and are the
> primary recipient of messages from menus and panels. Usually a window
> is made key when the user clicks it. Each application can have only
> one key window."
>
> Now, I think I understand what this is saying, but I want to be sure.
> I think that it means that an application can have multiple key
> windows, but that only one of them is ever ACTIVE (receiving
> keystrokes) at a given time.

nope, you are using different terminology than apple does. there is only one
key window at a time. note up there, where you said there can be only one
ACTIVE window? replace that with "key." there can be only one "key" window
at a time.

to further confuse matters, there's also the "main" window, and it's probably
not referring to what you'd think. you can have different main windows at
different times. this is to support the concept of floating tool windows.
say you're mousing info into a color selection panel, and in doing so, you're
changing the color of something in some other window. the color panel would
be the key window, and the one that's having its color changed is the main
window.
Back to top
Login to vote
Mike Hofer

External


Since: Jul 04, 2005
Posts: 3



(Msg. 3) Posted: Sun Jul 03, 2005 5:17 am
Post subject: Re: Question Regarding Key Windows [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

First off, thanks very much for the reply. It was tremendously helpful.

>nope, you are using different terminology than apple does.

That pretty much follows. I'm trying to understand it in the context of
what I've known for years, which probably isn't going to work very well
(if at all). But I *really* want to understand this stuff. Given your
response, I'm glad I asked. Smile
> there is only one key window at a time. note up there, where you said there
> can be only one ACTIVE window? replace that with "key." there can be
> only one "key" window at a time.

Okay, I think I got it now. A window becomes THE key window when it's
makeKeyAndOrderFront method is called. When it becomes the key, the
previous key window ceases to be the key window. In Windows, we'd say that
only one window can have the input focus at a time. That window responds to
key presses. If you want another window to have the focus, you have to
move the input focus to that window. When you do that, no other windows
get keystrokes. The two are analogous. I think.
>to further confuse matters, there's also the "main" window, and it's probably
>not referring to what you'd think. you can have different main windows at
>different times. this is to support the concept of floating tool windows.
>say you're mousing info into a color selection panel, and in doing so, you're
>changing the color of something in some other window. the color panel would
>be the key window, and the one that's having its color changed is the main
>window.

I'll grapple with that topic when I get to it!!! :-D



--
Back to top
Login to vote
Display posts from previous:   
Related Topics:
NSSavePanel question - I have a very basic NSSavePanel question: How do I disable the "... already exists. Do you want to replace it?" dialog box when an existing file is chosen? -- Tord Romstad

Safari extension question - My company recently released an extension for IE and a FireFox (also Windows) version is in beta right now. I am very interested in releasing this tool for Safari as well, and while I have done some Mac development before, I haven't touched Safari..

[BINDINGS] NSTableView vs. NSUserDefaultsController - I've already posted the following message to Apple's cocoa-dev mailing list, so if you subscribe to that list or are a regular reader of CocoaBuilder.com, you've already seen this. I'm posting here since I've appeared to have violated list..

Any tame MAC users out there ? - Hi all, could anyone tell me why the HTML generated from an XSL/XML merge would not display on an apple Mac. http://www.bedfords.co.uk/pages/search/search.asp (and just click "search") The page works fine on IE5,IE6, Mozilla and Firefox. Th...

[ANN] ADHOC/MacHack sessions announcement & the Transition.. - Apple is moving to Intel -- Don't Panic! Come to ADHOC and learn what developers need to do. Held in Dearborn, Michigan from July 27th through 31st (a little over a month after WWDC), ADHOC has always been focused on giving developers the edge when i...
       Mac (Home) -> General Discussion All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum
Categories:
 Windows Forums
 Game Forums
 Linux Forums
  Mac Forums
 PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact