toxicsoftware.com

RANDOMIZE USR 0

toxicsoftware.com header image 4

AcornImage

February 19th, 2008 · 7 Comments · Default

It was just your typical InterfaceBuilder 3 window…

[Read more →]

Tags:····

R.I.P Toxic Progress Indicator

October 30th, 2007 · 2 Comments · Default

Thanks to Matt Gemmell for pointing out that Apple has finally provided a pie chart style NSProgressIndicator for the circular/determinate modes. This style is new to Leopard. This means my Toxic Progress Indicator class can be retired, at least for 10.5+ only applications. Leopard has really helped to retire a lot of my code (for [...]

[Read more →]

Tags:···

SpaceNavigator controlled Lego Mindstorms NXT

September 26th, 2007 · 2 Comments · Default

It’s my second year of coaching a First Lego League team. The experience has been fantastic, I’m teaching 4th and 5th grade children about robots and computers, and teaching them to build and program their own robots. This year the kids are going to be learning how to use the new Lego Mindstorms NXT robot; [...]

[Read more →]

Tags:······

The Intersection of Cool and Awesome

September 25th, 2007 · 12 Comments · Default

3Dconnexion (a division of Logitech) produces the coolest named device ever: The 3Dconnexion SpaceNavigator . This is a 3D input device with 6 degrees of freedom, meaning you can move and rotate it through the X, Y and Z planes. I bought it originally on a whim (hey only 50 bucks!) for use with Google Sketchup [...]

[Read more →]

Tags:·····

‘Discrete’ NSLevelIndicatorCell too slow

June 24th, 2006 · 6 Comments · Default

I recently needed to embed the ‘Discrete’ variant of the NSLevelIndicatorCell into an NSTableView. The discrete cell looks like this:

Unfortunately adding the cell caused drawing of the table’s window to slow to crawl. The spinning beachball of death would often appear when I was merely resizing the window. After some quick experimented I narrowed [...]

[Read more →]

Tags:····

Grab that Invocation

June 23rd, 2006 · 3 Comments · Default

CInvocationGrabber is a Cocoa class to help with creating NSInvocation objects.

NSInvocation objects are Cocoa’s equivalent of “functors” and are extremely handy. But unfortunately creating them is often a pain. For example, take the following code showing how to create a simple NSInvocation:

NSInvocation *theInvocation = [NSInvocation invocationWithMethodSignature:[theString methodSignatureForSelector:@selector(insertString:atIndex:)]]; [theInvocation setSelector:@selector(insertString:atIndex:)]; [theInvocation setTarget:theString]; NSString *theFirstArgument = "Hello World"; [theInvocation setArgument:&theFirstArgument atIndex:2]; unsigned [...]

[Read more →]

Tags:··

Toxic Progress Indicator Updated

June 21st, 2006 · No Comments · Default

Thanks to Daniel Jalkut for submitting a patch to Toxic Progress Indicator. The patches fixes a couple of silly bugs with setMinValue/setMaxValue and also makes the code a little bit more generic. I’ve updated subversion with the patch, which is recommended for all uses of ToxicProgressIndicator (both of you).

[Read more →]

Tags:··

Cocoa: Fetching all attachments from an NSAttributedString

November 27th, 2003 · No Comments · Default

This code snippet is a category of NSAttributedString that shows how to fetch all attachments from the string.

Header:

@interface NSAttributedString (NSAttributedString_MoreExtensions)

/** * @method allAttachments * @abstract Fetchs all attachments from an NSAttributedString. * @discussion This method searchs for NSAttachmentAttributeName attributes within the string instead of searching for NSAttachmentCharacter characters. */ - (NSArray *)allAttachments;

@end

Source:

@implementation [...]

[Read more →]

Tags:··