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
9
votes
1 answer

Convert Virtual Key Code to unicode string

I have some code I've been using to get the current keyboard layout and convert a virtual key code into a string. This works great in most situations, but I'm having trouble with some specific cases. The one that brought this to light is the accent…
Joshua Weinberg
  • 28,598
  • 2
  • 97
  • 90
9
votes
2 answers

Getting key names for keyboard codes in Swift

I know others have asked similar questions, but I haven’t seen a definitive answer, and I’m still stuck. I’m trying to write a Swift function that takes a hardware-generated keyboard scan code, such as from an NSEvent, and returns the…
Jeff J
  • 139
  • 8
9
votes
3 answers

How to programmatically simulate a mouse click without moving mouse in Cocoa

I am interested in simulating a mouse click event/keyboard stroke on Mac OS X without actually moving the mouse. In Windows, it is possible to do this using messages: win32: simulate a click without simulating mouse movement? Is there an analog of…
Dany Joumaa
  • 2,030
  • 6
  • 30
  • 45
8
votes
1 answer

Core Audio and the Phantom Device ID

So here's what is going on. I am attempting to work with Core Audio, specifically input devices. I want to mute, change volume, etc, etc. I've encountered something absolutely bizarre that I cannot figure out. Thus far, google has been of no…
Tyler
  • 1,603
  • 13
  • 21
8
votes
1 answer

OpenGL 3.2 context on a Carbon window (OS Lion, Mono)

I'm trying to add modern OS X support to OpenTK framework. Mac OS Lion supports OpenGL 3.2 Core context. I can successfully obtain it by using CGL. However, I can't find a straight way to bind the context to a Carbon window. Previous OpenTK…
kvark
  • 5,291
  • 2
  • 24
  • 33
8
votes
1 answer

Displaying file copy progress using FSCopyObjectAsync

It appears after much searching that there seems to be a common problem when trying to do a file copy and show a progress indicator relative to the amount of the file that has been copied. After spending some considerable time trying to resolve this…
8
votes
4 answers

difference between carbon and cocoa?

What is the difference between carbon and cocoa ? For what type of applications we should use carbon and for what type of applications we should use cocoa ? Which is the best of both for developing applications in Mac OS ?
srikanth rongali
  • 1,463
  • 4
  • 28
  • 53
7
votes
2 answers

Why did Apple previously typedef reference (pointer) types but not now?

I've been wondering why Apple uses data types in Core Foundation that are typedef'd to a pointer type while in Cocoa they are not. As an example, you would reference a UIColor object like UIColor * while a reference to a CGColor object would be…
Ben Baron
  • 14,496
  • 12
  • 55
  • 65
7
votes
4 answers

How to get current type of mouse cursor in Mac OS X?

How can I get the current type of mouse cursor on screen? (Not only on my app window, globally.) Or is it at least possible to detect whether the default cursor is currently displayed? Either Carbon or Cocoa is OK – or even other working APIs,…
Cloudream
  • 631
  • 6
  • 14
7
votes
4 answers

Add badge icon overlay to Finder icons and folders?

When we open Dropbox folder, we can see icon on the left bottom of the folder. I am developing an application in which i also want the same behavior. If folder is syncing then it will show sync icon and for other operation it will show other icon.…
Parag Bafna
  • 22,812
  • 8
  • 71
  • 144
7
votes
3 answers

When calling TransformProcessType(), the app menu doesn't show up

If you call TransformProcessType() like this : ProcessSerialNumber psn = { 0, kCurrentProcess }; (void) TransformProcessType(&psn, kProcessTransformToForegroundApplication); Then the cocoa app menu doesn't show up unless you call this early…
Fatso
  • 1,278
  • 16
  • 46
7
votes
2 answers

Same QtOpenGL code runs as about 15 times slower when going to Carbon (vs Cocoa)

I'm developing a very simple application for the Mac OSX platform making use of Qt and OpenGL (and QtOpenGL) so crossplatform gets easier. The application receive a variable number of video streams that have to be rendered to the screen. Each frame…
Noti
  • 201
  • 2
  • 5
7
votes
0 answers

Disable CMD+Tab application switcher

I'm trying to disable the CMD + Tab application switcher, so that my application can register that hotkey. I'm looking for something that applications like Witch and LiteSwitch X are able to do (i.e. allow users to use CMD + Tab as the hotkey for my…
bogdansrc
  • 1,338
  • 2
  • 15
  • 28
7
votes
3 answers

CGEventTapCreate breaks down mysteriously with "key down" events

I'm using CGEventTapCreate to "steal" media keys from iTunes when my app is running. The code inside of the callback that I pass to CGEventTapCreate examines the event, and if it finds that it's one of the media keys, posts an appropriate…
svintus
  • 1,562
  • 2
  • 18
  • 22
7
votes
1 answer

Alternative Menu Items in NSMenu

I have an NSMenu that contains NSMenuItems with custom views. I want it so that when the alt button is pressed, the menu items would change part of their look (through their view). I found setAlternative in the NSMenuItem docs, however, in…
Nick Paulson
  • 111
  • 1
  • 5
1 2
3
36 37