Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Identify Cocoa apps with the command key System
A terribly simple of way of telling whether an application is Cocoa or not...

While the application is in the backround, but still visible on the screen, hold down the command key and try to manipulate any user interface element (scroll bar, popup menu, it doesn't matter). If the application stays in the background, it's Cocoa.

Also of note (though I think it's been mentioned here before) is that almost any application will allow you to move windows around with the command key held down and they will stay in the background (regardless of whether they ar Cocoa or Carbon). This has actually worked since before OS X.
    •    
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[6,615 views]  

Identify Cocoa apps with the command key | 15 comments | Create New Account
Click here to return to the 'Identify Cocoa apps with the command key' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
el bid completely baffled
Authored by: el bid on May 19, '02 02:36:32PM

The test for whether an app is Cocoa is that a Cocoa app stays in the background when you hold down the Command key and try to manipulate it, except that non-Cocoa apps like Finder also behave the same way?

If that's a "valid and useful test", why not just say that you need to look at an app, and if you can see it then it's Cocoa, except that non-Cocoa apps behave the same way? This test is equally valid, but has the advantage that you can apply it without having to reach for the mouse... :-)

--
el bid



[ Reply to This | # ]
Throbbing with mouse button down
Authored by: sabi on May 19, '02 03:09:41PM

Another test for Cocoa is to hold the mouse button down in a window
with a default (throbbing, pulsating, etc.) button in it. If the
animation stops, it's Carbon; if not, it's probably Cocoa.



[ Reply to This | # ]
Silly wabbit
Authored by: thinkyhead on May 19, '02 03:35:53PM

Sorry, but this hint is just plain wrong. I have plenty of Carbon applications that have this behavior. The "difference" is that authors of Carbon applications using the classic event model have to implement the code to handle the command-click, whereas it comes for free in Cocoa.

It used to be that you could tell Carbon from Cocoa by resizing a window. If the window implemented "live" resizing it was a Carbon app. If it used an outline then it was a Cocoa application. (I know, shouldn't it be the other way around?) But that distinction will soon be going away.



[ Reply to This | # ]
Seems to work for me
Authored by: aranor on May 19, '02 04:32:17PM

This works for me. I haven't found a single Carbon app (not even the finder) that can make the UI elements react to a command-click without activating the app. But Cocoa apps do this fine. To test: Open a new finder window, go to a folder that activates the vertical scrollbar. Go to a different app and try to command-drag the scrollbar tab. The Finder activates. Now try it with SNAX. SNAX will stay in the background.

What was described as working on Carbon apps as well is command-dragging the titlebar of a window, which works in all apps regardless of Carbon or Cocoa status.



[ Reply to This | # ]
Ditto here...
Authored by: robg on May 19, '02 04:44:48PM

I tested this before I published it -- excluding click and drag on a window title bar, any click in the Finder (or IE or Mozilla or about five others I tested it with) brings the app immediately to the foreground; a command-click in a Cocoa app does no such thing.

So to disprove the tip, can someone name a Carbon app that will stay in the background when command clicked? None of mine seem to...

-rob.



[ Reply to This | # ]
re: Seems to work for me
Authored by: eo on May 19, '02 06:42:29PM

Gotta say it works. Cool! You naysayers aren't just command-dragging the window titlebar are you? That ain't the tip.



[ Reply to This | # ]
re: Seems to work for me
Authored by: el bid on May 20, '02 05:42:59AM
You naysayers aren't just command-dragging the window titlebar are you? That ain't the tip.

Well, let's not make a Federal case out of it, but the original hint said:

hold down the command key and try to manipulate
any user interface element (scroll bar, popup menu,
it doesn't matter)

The simplest UI element is the window itself, and that's what I manipulated in trying a quick test of the theory.

Ah, but the window doesn't belong to the app. The window is provided for the app by the window manager.

So, yes, you're right, and I am a very silly el bid.

But as I say, let's not make a Federal case out of it. :-)

--
el bid


[ Reply to This | # ]
Try this
Authored by: oeyvind on May 20, '02 02:36:09AM

try this:

Cocoa:

% file /Applications/TextEdit.app/Contents/MacOS/TextEdit
/Applications/TextEdit.app/Contents/MacOS/TextEdit: Mach-O executable ppc

onyx % file /Applications/OmniWeb.app/Contents/MacOS/OmniWeb
/Applications/OmniWeb.app/Contents/MacOS/OmniWeb: Mach-O executable ppc

Carbon:

% file /Applications/Final\\ Cut\\ Pro.app/Contents/MacOS/Final\\ Cut\\ Pro
/Applications/Final Cut Pro.app/Contents/MacOS/Final Cut Pro: CFM binary

% file /Applications/Microsoft\\ Office\\ X/Microsoft\\ Word
/Applications/Microsoft Office X/Microsoft Word: CFM binary



[ Reply to This | # ]
Try this
Authored by: bhines on May 20, '02 05:29:59AM

er, you can make Mach-O carbon apps easily:

file /Applications/Tex-Edit\ Plus.app/Contents/MacOS/Tex-Edit\ Plus
Tex-Edit Plus.app/Contents/MacOS/Tex-Edit Plus: Mach-O executable ppc

In fact, the only kind of carbon apps Project Builder can make are Mach-O ones. (start PB, compile the default carbon stationery, it will be machO)

Not very many shipping carbon apps are Mach-O, though.



[ Reply to This | # ]
Command-click on title-bar to focus
Authored by: adrianu on May 20, '02 06:43:22AM
Actually, there is something well worth trying that is related to this.

If you command-click on the title-bar of a Cocoa app's window, it will gain the focus without coming in front - i.e. you can type things into a Cocoa app's window without it being frontmost.

I'm not aware of any Carbon apps that have implemented this natural feature of Cocoa (although it could certainly be emulated).

Bye!

Adrian


[ Reply to This | # ]
Command-click on title-bar to focus
Authored by: adrianu on May 20, '02 06:46:03AM

I should add that it only works if the Cocoa app is already frontmost - i.e. you have to have one of its windows in front before you can focus another by command-click in its title-bar.

Bye!

Adrian



[ Reply to This | # ]
Another easy way to identify a Cocoa app
Authored by: JKT on May 20, '02 08:10:43AM

Through the scroll bars:

Click a scrollbar arrow and hold the click - the scrollbar will start scrolling in the direction of the arrow. Now whilst still holding the click, move the pointer over the other scrollbar arrow... if the app is Cocoa, the focus will switch to the second arrow and scrolling will change to the opposite direction; if it is Carbon, the scrolling will simply stop as soon as you move the pointer away from the original arrow.

(obviously, this is easiest to check if the arrows are together at one or both ends)



[ Reply to This | # ]
use XRay
Authored by: soob on May 20, '02 11:29:11AM

If you use XRay to get info on an application, it'll tell you if it's carbon or cocoa on the first panel.

Jim



[ Reply to This | # ]
Easier
Authored by: echo on May 20, '02 03:29:27PM

If you press the "help" key in a Cocoa app, the cursor changes to a question mark.



[ Reply to This | # ]
I am dying to know...
Authored by: hombre on Jul 05, '02 07:26:13AM

... what the function of that question-mark cursor is.



[ Reply to This | # ]