macos-carbon

How to refresh finder window?

血红的双手。 提交于 2019-12-03 20:41:44
I want to refresh icon for particular file/folder in Finder application. FNNotifyByPath( (const UInt8 *)folderPath, kFNDirectoryModifiedMessage, kNilOptions ); FNNotifyByPath is not working for this. Now i am trying with appleScript +(void) refreshIconForItem : (NSString *)itemPath { NSString *source=[NSString stringWithFormat:@"tell application \"Finder\" to update \"%@\"",[NSString stringWithUTF8String:itemPath]]; NSAppleScript *update=[[NSAppleScript alloc] initWithSource:source]; NSDictionary *err; [update executeAndReturnError:&err]; } but this function is also not working. Can anyone

Globally hide mouse cursor in Cocoa/Carbon?

会有一股神秘感。 提交于 2019-12-03 17:15:27
问题 Is there a way to globally hide the mouse cursor for all apps in Cocoa (or Carbon)? Or at least replace it with something else? EDIT: Thanks for the input guys, but turns out Daniel Jalkut found the solution a while ago :) http://lists.apple.com/archives/carbon-dev/2006/Jan/msg00555.html 回答1: You are looking for CGDisplayHideCursor, which is part of the Quartz Display Services API. 回答2: just add this to your code: CGDisplayHideCursor (kCGNullDirectDisplay); 回答3: Check out: http://developer

OS X equivalent to OutputDebugString()?

拜拜、爱过 提交于 2019-12-03 17:13:17
问题 I'm examining the feasibility of porting an existing Windows MFC control to OS X/Carbon. My test bed is a C++ Carbon application generated using the XCode 3 Wizard. I'm looking for a quick way to dump some trace info to the debugger or the OS X equivalent of DbgView. On Win32 I'd use OutputDebugString() - what's the deal on OS X? Is there a way to view test written to std::cout from a Carbon app? Thanks Jerry 回答1: There is no real equivalent. Xcode uses GDB under the hood, so you're basically

Mac OS X Window Server vs. X11: the insane task

岁酱吖の 提交于 2019-12-03 16:29:53
Dedicated to all who likes low-level Window Server (CoreGraphicsPrivate.h, etc), X11 on Mac, SIMBL and other crazy stuff :) There's a simple X11-emulated application on Mac (like xterm, xeyes and so on) with one window. While running, X11 somehow creates a native Quartz window to represent this emulated application, and this window is accessible via Quartz Window Services so that I can get its CSWindowID, title, position, size and owner's PID (PID of X11.app). But it does not support Accessibility API, so there's no way to control it (except, maybe Core Graphichs private functions from the

How can i add icon overlay in finder?

心不动则不痛 提交于 2019-12-03 15:06:08
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 :) Starting with Yosemite (10.10), there is now an officially supported (and thus Mac App Store

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

…衆ロ難τιáo~ 提交于 2019-12-03 07:10:33
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 this for Mac OS X? I am aware of Quartz Event Services , but it seems that that API would only restrict me to sending events to the current key window. Is this true? Is it possible to send keyboard/mouse events to non-key windows? I really just need to be able to send a keyboard command to another app. John Dorian I know this is an old thread, but I

Globally hide mouse cursor in Cocoa/Carbon?

时间秒杀一切 提交于 2019-12-03 06:14:06
Is there a way to globally hide the mouse cursor for all apps in Cocoa (or Carbon)? Or at least replace it with something else? EDIT: Thanks for the input guys, but turns out Daniel Jalkut found the solution a while ago :) http://lists.apple.com/archives/carbon-dev/2006/Jan/msg00555.html You are looking for CGDisplayHideCursor , which is part of the Quartz Display Services API. just add this to your code: CGDisplayHideCursor (kCGNullDirectDisplay); Check out: http://developer.apple.com/legacy/mac/library/samplecode/CarbonCocoa_PictureCursor/listing2.html It's an old sample, but probably still

Debugging a NULL CGContext under Cocoa/Carbon

这一生的挚爱 提交于 2019-12-03 05:59:47
问题 During the execution of my program I'm getting the following output in the XCode debugging console: <Error>: CGContextSetTextMatrix: invalid context 0x0 I have no idea where in the application this NULL-context is being passed to the OS. Anyone know of a good technique to hunt it down? Can I break into the application when something is written to stdout ? 回答1: Adding a breakpoint in the gdb console for CGPostError breaks when the OS writes a CG-related error to stderr . 来源: https:/

OS X equivalent to OutputDebugString()?

﹥>﹥吖頭↗ 提交于 2019-12-03 05:26:27
I'm examining the feasibility of porting an existing Windows MFC control to OS X/Carbon. My test bed is a C++ Carbon application generated using the XCode 3 Wizard. I'm looking for a quick way to dump some trace info to the debugger or the OS X equivalent of DbgView. On Win32 I'd use OutputDebugString() - what's the deal on OS X? Is there a way to view test written to std::cout from a Carbon app? Thanks Jerry There is no real equivalent. Xcode uses GDB under the hood, so you're basically dealing with that. You could, however, implement it yourself. The code sample below will produce output to

Compiling Bochs on Mac os x Snow Leopard

若如初见. 提交于 2019-12-03 03:03:00
Was someone able to compile the Bochs simulator under Snow Leopard. Leopard worked fine for me but under Snow Leopard I get alot of problems related to the Carbon library... Ok, some more information was request. I compile with make on the shell; stanard build process coming with the bochs sources I was successfully able to compile against the 10.5 SDK. Unfortunatley, it was not running under Snow Leopard... always crashed then I installed the latest XCode from the SnowLeopard CD and compiled against the 10.6 SDK; withot changing nothing but the isysroot flag to point to the 10.6 instead of 10