macos-carbon

How can i add icon overlay in finder?

ε祈祈猫儿з 提交于 2019-12-09 11:51:15
问题 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. The marked files/folder when viewed in Finder must be shown with a custom icon. But when they are selected for preview ( using spacebar) they must show their original icon ( i.e the blue icon for folder etc) . Can anyone please help me out ?? Thanks

migrating an application from carbon to cocoa

依然范特西╮ 提交于 2019-12-09 04:18:37
问题 I am working on an application in which I need to migrate the whole code of it from carbon to cocoa.I have experience in programming of C,C++,python and Java during my college time and internship but have never touched objective C or have done any programming for Mac(Carbon and Cocoa) before this. So Can you please suggest me some sources to start with, also how should I go about the whole migration ? After researching on net I have found that most the people have suggested following books

Is it safe to call CFRunLoopStop from another thread?

旧巷老猫 提交于 2019-12-08 21:41:19
问题 The Mac build of my (mainly POSIX) application spawns a child thread that calls CFRunLoopRun() to do an event loop (to get network configuration change events from MacOS). When it's time to pack things up and go away, the main thread calls CFRunLoopStop() on the child thread's run-loop, at which point CFRunLoopRun() returns in the child thread, the child thread exits, and the main thread (which was blocking waiting for the child thread to exit) can continue. This appears to work, but my

Tap AppleEvents being sent to another application

让人想犯罪 __ 提交于 2019-12-08 05:03:30
Is it possible to monitor or tap the stream of Apple Events being sent to a process, in the same way you can tap Quartz Events? I have an application that talks to another application to force it to import files, but it does so in a way that's unavailable through menus or UI scripting, and I'm trying to track down how it does this. Do you need to do this programmatically or is manual/interactive OK? If manual is OK, here are some approaches: Try using AppleScript Editor to record the target app. Try using the techniques listed in Technical Note TN2124: Mac OS X Debugging Magic under Apple

Exception wrapper for Carbon C app in OSX

南笙酒味 提交于 2019-12-07 13:42:17
问题 How can I efficiently catch and handle segmentation faults from C in an OSX Carbon application? Background: I am making an OSX Carbon application. I must call a library function from a third party. Because of threading issues, the function can occasionally crash, usually because it's updating itself from one thread, and it's got some internally stale pointer or handle as I query it from another. The function is a black box to me. I want to be able to call the function but be able to "catch"

Using `CGEventSourceSetLocalEventsSuppressionInterval` instead of the deprecated `CGSetLocalEventsSuppressionInterval`

筅森魡賤 提交于 2019-12-07 12:12:32
问题 When programmatically moving the mouse cursor, you must set CGSetLocalEventsSuppressionInterval to 0 so the events come in in real-time as opposed to with a 250 millisecond delay. Unfortunately, CGSetLocalEventsSuppressionInterval is marked as deprecated in Snow Leopard. The alternative is CGEventSourceSetLocalEventsSuppressionInterval(CGEventSourceRef source, CFTimeInterval seconds); https://developer.apple.com/library/mac/#documentation/Carbon/Reference/QuartzEventServicesRef/Reference

Event taps: Varying results with CGEventPost, kCGSessionEventTap, kCGAnnotatedSessionEventTap, CGEventTapPostEvent

安稳与你 提交于 2019-12-07 10:47:06
问题 I'm running into a thorny problem with posting an event from an event tap. I'm tapping for NSSystemDefined at kCGHIDEventTap, then replacing the event with a new one. The problem I'm running in to is that depending on how I post the event, it's being seen only by some applications. My test applications are Opera, Firefox, Quicksilver, and Xcode. Here are the different techniques I've tried within my event tap callback, with results. I'm expecting an action (the "correct response") from each

How to hide application icon from Mac OS X dock

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 10:01:11
问题 I have a wxpython script, which creates a wx.App and a frame, hides it and does some processing using hidden frame. I do not want this script's icon to appear in Mac dock but it comes. So how can i hide it, I did not find anything in wxPython so it there some carbon API which I can call? Simplest python script makes icon to appear >>> import wx >>> app = wx.App() 回答1: I was not able to find a way to hide app icon programmatically, only way seems to be to set LSUIElement=1 in Info.plist, so

How can I stop HIToolbox from catching my exceptions?

 ̄綄美尐妖づ 提交于 2019-12-07 07:27:38
问题 This question follows on from my other question on why my app isn't being brought down by exceptions. The Problem When an exception is thrown on the main thread via an Action, the app still doesn't crash. As per Dave's answer to my original question, I've implemented the reportException category on NSApplication and set the uncaught exception handler. Code I've got the following in my app delegate, which I've hooked up to a button in my UI to test. -(IBAction)crashOnMainThread:(id)sender {

Scriptability (AppleScript) in a Mac Carbon application

元气小坏坏 提交于 2019-12-06 13:25:31
问题 I am trying to add AppleScripting support to my non-Cocoa based application. I'm working the low level functions such as AEGetParamDesc, handling the form / want / seld parameters myself. My vocabulary offers a class, let's call it "Image". It has a property "name". I've gotten some Applescript code working, such as: get Images get name of every Image get count Images get every Image get first Image get Image 1 So, basically, access to both the objects and its properties works. However, when