Re: Why Don't Cocoa's (Un)Archiving Methods return Errors?

2011-07-29 Thread Rainer Brockerhoff
might have left some memory leaks or partially uninitialized objects somewhere, but unarchiving an invalid object should happen rarely if at all... and ordinarily my own code should never get pointers to such objects, anyway. While personally I never had any problems with that try/catch block, I&

Re: cleanly support drag-to-trash for uninstall?

2011-08-06 Thread Rainer Brockerhoff
elf and exits. Works for me. Note that moving a running application to anywhere (not just the Trash) can lead to all sorts of path-dependent operations failing, so it's best to exit fast here. HTH, -- Rainer Brockerhoff Belo Horizonte, Brazil "In the affairs of others eve

Re: Graphical Keyboard Map

2011-08-15 Thread Rainer Brockerhoff
t or similar requests from Latin American users. Anyway, I'll be grateful for any further information about these issues. I suppose replies to this will be off-topic for Cocoa-dev, so please email me privately. -- Rainer Brockerhoff Belo Horizonte, Brazil "In t

Re: determine whether an ancillary program/task can run

2011-09-01 Thread Rainer Brockerhoff
OWERPC if applicable // if it returns non-null that architecture is present } (Disclaimer: partially written in Mail, proper consistency checking and so forth must be added) HTH, -- Rainer Brockerhoff Belo Horizonte, Brazil "In the affairs of others even fools are

Re: determine whether an ancillary program/task can run

2011-09-02 Thread Rainer Brockerhoff
On 02/09/2011, at 00:13, Ken Thomases wrote: > On Sep 1, 2011, at 6:42 PM, Rainer Brockerhoff wrote: > >> On 01/09/2011, at 20:17, cocoa-dev-requ...@lists.apple.com wrote: >>> From: Martin Wierschin >>> Date: 1 de setembro de 2011 19:11:24 BRT >>>

Re: UTI in Lion

2011-09-23 Thread Rainer Brockerhoff
rs them all either. PowerPC-only apps may be dropped out in 10.8, who knows. "Check for com.apple.application and be done with it" is very convenient, and OK as long as we remember it's not magic, and that the results with change with different releases. -- Rainer Brockerhoff Bel

Re: Finder Integration

2011-09-30 Thread Rainer Brockerhoff
dden .icon\r file inside the folder). Check out: http://developer.apple.com/legacy/mac/library/documentation/Carbon/Conceptual/Icon_Service_nd_Utilities/IconServUtili.pdf and http://www.cocoabuilder.com/archive/cocoa/95797-finder-icon-badging.html HTH, -- Rainer Brockerhoff Belo Horizonte, B

Re: Dismissing Open dlog before doc actually opens

2013-08-14 Thread Rainer Brockerhoff
y out with NSDocument though... :-/ HTH, -- Rainer Brockerhoff Belo Horizonte, Brazil "In the affairs of others even fools are wise In their own business even sages err." http://brockerhoff.net/blog/ ___ Cocoa-dev mailing list (Cocoa-dev@lists

Re: Alternative to NSRunningApplication launchDate?

2014-08-01 Thread Rainer Brockerhoff
PI? The old Process Manager APIs - specifically, GetProcessPID(), GetNextProcess() and GetProcessInformation() - do what you want; they were deprecated in 10.9 but still work on 10.10. And, as far as I know, no substitute API has been announced yet. HTH, -- Rainer Brockerhoff Belo Horizonte, Braz

Re: dispatch_sync(dispatch_get_main_queue() UI weirdness

2014-09-06 Thread Rainer Brockerhoff
is doing some background stuff // and I need a file from the user so // code blah blah code RunBlockOnMainThread(^{ NSOpenPanel *op = [NSOpenPanel openPanel]; [op beginWithCompletionHandler:^{ // handle the open panel results here }]; });

Re: dispatch_sync(dispatch_get_main_queue() UI weirdness

2014-09-06 Thread Rainer Brockerhoff
On 9/6/14, 14:50, Ken Thomases wrote: > On Sep 6, 2014, at 7:59 AM, Rainer Brockerhoff wrote: > ... > ... But never do modal stuff in that block. > > Why not do modal stuff in such a block? I don't think this function > is subject to the same serializing problem I d

Re: setApplicationIconImage:

2015-01-24 Thread Rainer Brockerhoff
e application itself. The method should, perhaps, be called "setProcessIconImage:" :-) -- Rainer Brockerhoff Belo Horizonte, Brazil "In the affairs of others even fools are wise In their own business even sages err." http://brockerhoff.net/blog/

Re: Determine encoding of file

2010-07-30 Thread Rainer Brockerhoff
Sweep.zip check the last method in AppController.m. HTH, -- Rainer Brockerhoff Belo Horizonte, Brazil "In the affairs of others even fools are wise In their own business even sages err." Blog: http://brockerhoff.net/blog ___ Cocoa-dev mailing

Re: Code sign verification in Leopard

2010-08-17 Thread Rainer Brockerhoff
H"lotsofhexcharacters" note that anyone can change and re-sign your bundle with the same identity name, but the "lotsofhexcharacters" are unique to your own self-signed certificate. Also, running codesign -vv mybundlepath should print "valid on disk" if the bundle is intact

Re: Adding subviews to collapsed splitview

2010-10-01 Thread Rainer Brockerhoff
add the subview at runtime? And are you actually adding the inner RBSplitView directly as a subview to the outer one (which is recommended), or inserting it into an empty RBSplitSubview? You could try calling -adjustSubviews on the inner RBSplitView after adding it, which should force it

Re: How to create secondary Thread that listens to event taps?

2010-10-17 Thread Rainer Brockerhoff
loc] init]; SInt32 result = CFRunLoopRunInMode(kCFRunLoopDefaultMode,0.5,YES); [pool drain]; if (result==kCFRunLoopRunStopped)) { return; } } should work. HTH, -- Rainer Brockerhoff Belo Horizonte, Brazil &q

Re: How to create secondary Thread that listens to event taps?

2010-10-19 Thread Rainer Brockerhoff
t;condition" being set to NO. I usually set something between 0.5 and 1; it's optimal in the sense "works-for-me" ;-) -- Rainer Brockerhoff Belo Horizonte, Brazil "In the affairs of others even fools are wise In their own business even sages err." Blog: http://

Re: How to create secondary Thread that listens to event taps?

2010-10-20 Thread Rainer Brockerhoff
At 22:44 -0700 19/10/10, Chris Hanson wrote: >On Oct 19, 2010, at 12:41 PM, Rainer Brockerhoff wrote: > >> A too-low value will make your thread activate too often (making it use more >> CPU when idle) and a too-high value will make it too slow to react to >> "

Re: NSSavePanel runModal isn't working in sandbox?

2012-06-06 Thread Rainer Brockerhoff
el runModal]; I've had no problems at all with NSSavePanel under the sandbox (the inherited methods limitation that Graham mentioned excepted). My usage looks almost exactly like the code above except that I call -beginSheetModalForWindow:completionHandler: instead of -runModal. BUT. You n

Re: Defining subclasses at run time

2012-06-11 Thread Rainer Brockerhoff
context and the actual array, and implementing all the proper methods. However, what I used in a similar situation is objc_getAssociatedObject() and objc_setAssociatedObject() in objc/runtime.h. Look them up. HTH, -- Rainer Brockerhoff Belo Horizonte, Brazil "In the affairs of others even

Re: NSSplitView question - how to implement my own "adjustViews" style method

2012-07-03 Thread Rainer Brockerhoff
pull in the rest), it still seems to work well. If you want to roll your own, my advice would be to at least glance at the RBSplitView code (and docs) beforehand. Looking back, the crucial decision seems to have been to implement RBSplitSubviews to handle most of the work. Good luck, ;-) -- Rain

Re: NSSplitView question - how to implement my own "adjustViews" style method

2012-07-03 Thread Rainer Brockerhoff
might be to implement something like +[RBSplitView transmogrify:(NSSplitView*)someSplitView]. All the cool extra RBSplitSubview properties would, of course, have to set manually... hm. -- Rainer Brockerhoff Belo Horizonte, Brazil "In the affairs of others even fools are wise In their o

Re: NSSplitView question - how to implement my own "adjustViews" style method

2012-07-03 Thread Rainer Brockerhoff
On Jul 3, 2012, at 12:11 , Andy Lee wrote: > On Jul 3, 2012, at 10:31 AM, Rainer Brockerhoff wrote: >> Now that's an interesting idea, thanks Andy! I'll look into it soon, I hope. > > P.P.S. I'm not sure how to deal with autolayout constraints that might get >

Re: NSSplitView question - how to implement my own "adjustViews" style method

2012-07-19 Thread Rainer Brockerhoff
email? Offhand I don't see any look&feel differences. Thanks, -- Rainer Brockerhoff Belo Horizonte, Brazil "In the affairs of others even fools are wise In their own business even sages err." Weblog: http://www.brockerhoff.net/blog __

Re: Repositioning another app's windows?

2012-08-01 Thread Rainer Brockerhoff
s the process to install > other/special taps > - com.apple.security.accessibility - allows the process to use accessibility > even if turned off in System Preferences. > - This also opens up the possibility of the system alerting the user the > first time an application with these cap

Re: How to make Obj-C collection subscripting work on iOS 5?

2012-08-20 Thread Rainer Brockerhoff
ector(objectAtIndexedSubscript:), @selector(objectAtIndex:)); PatchClassSwap([NSMutableOrderedSet class], @selector(setObject:atIndexedSubscript:)); This runs fine on both 10.7 and 10.8, so it should also work on iOS5 and iOS6. HTH, -- Rainer Brockerhoff Belo Horizonte, Brazil

Re: How to make Obj-C collection subscripting work on iOS 5?

2012-08-21 Thread Rainer Brockerhoff
On Aug 20, 2012, at 20:41 , Rainer Brockerhoff wrote: > I can confirm NSOrdered[Mutable]Set isn't covered by libarclite. Here's what > I'm using for that (easily extended to other classes: Oops. Forgot to take out my RBXCALL() macros (which just add a trivial test), so

Re: Need for a creator code?

2008-04-01 Thread Rainer Brockerhoff
ork now, although I haven't checked. Registering a code is much faster now - you get a response within minutes, instead of the week it used to take in the System 7 days. -- Rainer Brockerhoff <[EMAIL PROTECTED]> Belo Horizonte, Brazil "In the affairs of others even fools are wi

Re: Open-source NSToolbar?

2008-04-08 Thread Rainer Brockerhoff
t when I tried to some years ago, I hear it's gotten much better in Leopard? I'm more inclined to publish a RBFileObject at this time, however, since I've got most parts of that already done... -- Rainer Brockerhoff <[EMAIL PROTECTED]> Belo Horizonte, Brazil "In the

Re: recursive dir searching

2008-04-10 Thread Rainer Brockerhoff
earching: http://www.brockerhoff.net/src/ (scroll down to "FolderSweep"). MIT license (with attribution), so feel free to use it. HTH, -- Rainer Brockerhoff <[EMAIL PROTECTED]> Belo Horizonte, Brazil "In the affairs of others even fools are wise In t

Re: Calculating file size

2008-04-27 Thread Rainer Brockerhoff
he bit masks asking for both logical fork sizes, and sum them for every file (they're 64bit unsigned integers). -- Rainer Brockerhoff <[EMAIL PROTECTED]> Belo Horizonte, Brazil "In the affairs of others even fools are wise In their own business even sages err." Web

Re: NSSplitView

2009-01-05 Thread Rainer Brockerhoff
plitView does that automagically if you nest two of them: http://www.brockerhoff.net/src/rbs.html I really must find time to update it, but people tell me it still works well. HTH, -- Rainer Brockerhoff Belo Horizonte, Brazil "In the affairs of others even fools are wise In their own business

Re: App Listener?

2009-01-08 Thread Rainer Brockerhoff
at how HIToolbox does its magic, but it appears to be listening to a private notification from the Process Manager. And BSD, of course, has no concept of "front process". If nobody knows another public API for an app activation notification, I'll file an enhancement request.

Re: App Listener?

2009-01-08 Thread Rainer Brockerhoff
At 15:09 + 08/01/09, James Montgomerie wrote: >On 8 Jan 2009, at 14:14, Rainer Brockerhoff wrote: >>Today, the only solution seems to be to install a Carbon Event handler for >>the {kEventClassApplication, kEventAppFrontSwitched} event. > >If you don't mind aski

Re: Moving oneself to /Applications (or ~/Applications)

2009-02-24 Thread Rainer Brockerhoff
. While I'm not sure I was the first to use the symlink-to-Applications technique, I started using it in 2003 (see http://db.tidbits.com/article/8357). If you use it, be sure to use a symlink instead of a Finder-generated alias file; besides being larger, an alias may contain privat

Re: Problem with NSImage and .PNG file

2008-08-16 Thread Rainer Brockerhoff
t exactly into metric units, the >measurement is rounded up, producing the 72.009 value. >Solution: >When saving 72 dpi pictures, specify "unknown unit" in the 'pHYs' chunk. I haven't checked if that has been fixed in Leopard Preview, though; I suppose not, as t

Re: Determining preferred localizations

2010-04-22 Thread Rainer Brockerhoff
a similar problem this way: NSArray* inChoices = [[NSBundle mainBundle] localizations]; // probably that's what you're passing in? NSArray* theBestOnes = [NSBundle preferredLocalizationsFromArray:inChoices forPreferences:[NSLocale preferredLanguages]]; HTH, -- Rainer

Re: App name from Bundle Identifier?

2008-09-12 Thread Rainer Brockerhoff
not >match, the Finder displays the file-system name. Just as a heads-up/quibble, localized bundle names work only for .apps, not for .bundles (or any other common bundle extension that I tested against). I filed rdar://6209849 ... -- Rainer Brockerhoff <[EMAIL PROTECTED]> Belo Hori

Re: Creating alias programatically

2008-09-23 Thread Rainer Brockerhoff
> close(fd); That's the error. An alias file isn't just an alias handle written out into the data fork. You have to create a resource file (with a resource fork), the file's Finder flags should have the kIsAlias bit turned on, and then you save the alias Han

Re: Creating alias programatically

2008-09-24 Thread Rainer Brockerhoff
At 18:15 -0500 23/09/08, Ken Thomases wrote: >On Sep 23, 2008, at 5:54 PM, Rainer Brockerhoff wrote: >>That's news to me... I really can't recall right now where the alias file >>format was officially documented, but in the Classic days it was quite >>acc

Re: Conditional mouseDownCanMoveWindow for NSView?

2008-10-02 Thread Rainer Brockerhoff
ince the last event. [window setFrameOrigin:origin]; where = now; [pool release]; } } } -- Rainer Brockerhoff <[EMAIL PROTECTED]> Belo Horizonte, Brazil "In the affairs of o

Re: Drag Tabs, Custom Colors

2008-11-12 Thread Rainer Brockerhoff
plicationMain(argc, (const char **) argv); } For this specific key, it must be done before calling NSApplicationMain(). It works, but this is sort of a gray (hehe) area. The key "AppleAquaColorVariant" is undocumented. It's not too likely to change, but if it changes, your control color w

Re: Get size of folder

2009-08-19 Thread Rainer Brockerhoff
x.html or at: http://mattgemmell.com/2008/04/10/foldersweep-source-code You can directly get the data and resource fork sizes for every scanned file. -- Rainer Brockerhoff Belo Horizonte, Brazil "In the affairs of others even fools are wise In their own business even

Re: need advice on subclassing NSScrollVIew

2009-03-20 Thread Rainer Brockerhoff
there. Despite being somewhat more work to implement, this proved to be more efficient and also a good learning experience regarding the view drawing mechanism. HTH, -- Rainer Brockerhoff Belo Horizonte, Brazil "In the affairs of others even fools are

Re: Change view on resize

2009-04-10 Thread Rainer Brockerhoff
d >making it full screen or maximised has to be done by dragging. While implementing Klicko's window maximizing behavior, at first I noticed that iTunes didn't respond at all to the Accessibility command to set window size. However, since version 8 (I think), it does; also, optio

Re: String Comparison and return values

2009-05-26 Thread Rainer Brockerhoff
r, so none of the standard comparisons will work directly. Instead of testing what kind of class each is, I'd try something like if ([itemA intValue] == [itemB intValue]) ... since both NSString and NSNumber will respond to intValue, that sho

Re: Creating a NSView with Interface Builder

2008-02-26 Thread Rainer Brockerhoff
o this thread, but if you go to http://www.brockerhoff.net/pap.html and download the first paper in the list ("Plugged-In Cocoa"), you'll see detailed instructions and a sample project. It's from 2002 but everything should still work. Gut Glück, -- Rainer Brockerhof