Questions tagged [macos-carbon]

Carbon is Apple's previous application-development framework for Mac OS X for applications that needed to remain compatible with the Classic Mac OS.

Carbon is Apple's previous application-development framework for Mac OS X (), which existed primarily for applications that needed to remain compatible with the Classic Mac OS. Most of the original Carbon APIs existed both on Mac OS X and in a dynamic library (CarbonLib) for Mac OS 9.

Much of it is now deprecated and unavailable to 64-bit applications as of Mac OS X 10.6, but not all. Core Services (including the File Manager and even the Resource Manager) and much of Application Services (including ) are 64-bit-compatible, as are a few Carbon APIs, such as some parts of the Carbon Event Manager. Be sure of your ground before you tell a questioner they need to switch to Cocoa (); the API they're using may be perfectly safe, and may even be the only API specifically designed for their task (as part of Carbon Event Manager is for hotkeys).

Note that just because an API is in the Legacy Mac OS X Reference Library doesn't mean everything in it is deprecated or doomed. Again, Carbon Event Manager is an example.

547 questions
79
votes
16 answers

How do I determine the OS version at runtime in OS X or iOS (without using Gestalt)?

The Gestalt() function located in CarbonCore/OSUtils.h has been deprecated as of OS X 10.8 Mountain Lion. I often use this function to test the version of the OS X operating system at runtime (see the toy example below). What other API could be used…
Todd Ditchendorf
  • 11,217
  • 14
  • 69
  • 123
67
votes
5 answers

List of all users and groups

I'm trying to get a list of all users and all groups on Mac OS X 10.5+. How can I do this? For example, the list of all users on my machine should return: _amavisd, _appowner, _appserver, _ard, _atsserver, _calendar, _carddav, _clamav,…
Dave DeLong
  • 242,470
  • 58
  • 448
  • 498
30
votes
3 answers

Getting Window Number through OSX Accessibility API

I am working on an application that moves windows of third party applications around on the screen. To get an overview of all currently open windows, I use CGWindowListCopyWindowInfo(kCGWindowListOptionOnScreenOnly |…
0x90
  • 6,079
  • 2
  • 36
  • 55
26
votes
5 answers

Get real path of application from pid?

How can I get the process details like name of application & real path of application from process id? I am using Mac OS X.
RLT
  • 4,219
  • 4
  • 37
  • 91
26
votes
6 answers

How can Mac OS X games receive low-level keyboard input events?

Games need low-level access to keyboard input. On Windows, there's DirectInput. But what technology do Mac OS X game developers use? Obviously, there's enough Mac games which get keyboard input just right, without the drawbacks of the commonly…
CodeSmile
  • 64,284
  • 20
  • 132
  • 217
24
votes
1 answer

Linking against Apple frameworks with gcc

I've created some wrapper functions that encapsulate working with CoreAudio, and the goal is to create a C library that I can use with some command line C++ tools. So far things are working well. I took a sample project, modified it, and it builds…
Dr. Watson
  • 3,752
  • 4
  • 32
  • 43
23
votes
9 answers

How to detect whether an OS X application is already launched

Normally an application bundle on OS X can only be started once, however by simply copying the bundle the same application can be launched twice. What's the best strategy to detect and stop this possibility? On Windows this effect can simply be…
Per Ersson
  • 771
  • 2
  • 6
  • 10
23
votes
5 answers

Can't Start Carbon - 12.04 - Python Error - ImportError: cannot import name daemonize

I am really hoping someone can help me as I have spent at-least 15 hours trying to fix this problem. I have been given a task by a potential employer and my solution is to use graphite/carbon/collectd. I am trying to run and install carbon /…
Shane Baldacchino
  • 231
  • 1
  • 2
  • 3
20
votes
7 answers

Crafting .webloc file

I'm writing a program (for Mac OS X, using Objective-C) and I need to create a bunch of .webloc files programmatically. The .webloc file is simply file which is created after you drag-n-drop an URL from Safari's location bar to some…
Yurii Soldak
  • 1,458
  • 4
  • 19
  • 24
18
votes
3 answers

Mac event tap just delays discarded events

I'm trying to write some code that discards all keyboard and mouse events when enabled on Mac OSX 10.6. My code runs as the root user. The approach I'm taking is to create an event tap that discards all events passed to it (while enabled). The event…
Thomi
  • 11,647
  • 13
  • 72
  • 110
17
votes
4 answers

How can you load a font (TTF) from a file using Core Text?

Prior to OSX 10.6, ATSFontActivateFromFileSpecification/ATSFontActivateFromFileReference were available and could be used to load a font from a file. I can't find anything similar in Core Text.
miekelly
  • 281
  • 2
  • 7
15
votes
2 answers

Programmatically open Mac Help menu

I'm integrating a GTK# application into Mac OS X. GTK on Mac OS X is a wrapper over some Cocoa and Carbon fundamentals. We have some platform-specific stuff directly using Carbon global menu APIs (it's more low-level and flexible than Cocoa, and we…
Mikayla Hutchinson
  • 16,113
  • 2
  • 44
  • 50
15
votes
5 answers

Where can I get resources for developing for Mac OS Classic?

I recently got bored and fired up my old Mac OS Classic emulator, and then got nostalgic for writing old-school applications for the system. So, my question: Where can I get dev tools that can still target Classic? (Ideally free, since this is…
Benjamin Pollack
  • 27,594
  • 16
  • 81
  • 105
14
votes
2 answers

my system refuses to shut down/restart with NSAppleScript class

I am using CFPlugin for contextual menu and icon overlay on 10.5(same as scplugin). For communication between my application and finder , i am using distributed object. After installing my plugin inside Contextual menu items folder , my system…
Parag Bafna
  • 22,812
  • 8
  • 71
  • 144
14
votes
2 answers

Assembly GUI programming for Mac OS X

I’d like to know how can I do a simple assembly program for Mac OS X that shows a window on the screen and put some coloured text on that window. The code may call some Carbon or Cocoa APIs. I need some code for the nasm sintaxe. I saw in …
jose.pereira
  • 141
  • 1
  • 3
1
2 3
36 37