I encountered a question on StackOverflow today about how to add items to the favorites list in the Finder sidebar (which also appears in the standard Open and Save dialogs’ side bars). Though it’s already been answered before (I marked it as a duplicate, pointing to an answer from 2011), it appears the information is a bit outdated and contained no example code. I wrote, tested, and added the code to an updated answer. Not satisfied to stop there, I felt it would be easier to use if I created a simple category on NSURL
so you could tell a valid file URL directly to add itself to either the favorite items or favorite volumes list with one call. It’s compatible back to 10.5.
Easy UIFont Bold and Italic Trait Querying
With the arrival of some neat new libraries I can’t talk about yet, I wanted a convenient way to ask a UIFont
instance if it was bold or italic*. Although there’s no direct route as there is with NSFont
on Mac OS, It turns out it’s relatively easy to add this functionality to UIFont
via an Objective-C category.
The Recessed List Effect
It’s been awhile since I’ve posted any new Cocoa stuff. Especially anything as widely loved as JLNDragEffectManager. Since I love all that positive attention and am sorely disappointed by the recent falloff of ego-sustaining limelight, I thought I’d solve yet another of the Cocoa world’s problems and give you a rather easy way of mimicking the “recessed list effect” found in Dictionary.app. I was reminded of the effect by this StackOverflow post today (thanks, Li Fumin, for reminding me I wanted to figure this out).
Continue readingCatching Media Key Events
There was a great question on Stack Overflow today about how to catch media key events (such as play/pause or seek forward/backward) in your own app. I thought I’d post the solution I use in Transcriva.
Continue readingAuto-Sizing Token Field
I posted some source code (JLNAutoSizingTokenField) in response to a StackOverflow question. It’s another NSTokenField subclass that auto-sizes itself after editing and provides a method to flag it for autosizing.
Continue readingNon-Selecting Token Field
I posted some source code (NonSelectingTokenField) in response to a StackOverflow question. It avoids the default behavior of selecting all tokens when becoming first responder or ending editing.
Continue readingTalking Face Speech Synthesizer Demo
A question was posted on StackOverflow about whether the ability existed on the Mac OS to match a talking head or face to the spoken phonemes of the built-in speech synthesizer. The answer is: of course there is, it’s a Mac! I’ll show you how it’s done.
Continue readingDrag Effect In Action
Last week I posted my solution to the IB3-like drag-from-library-palette effect called “JLNDragEffectManager“. Today I released an update to XTabulator (2.002) that contains this effect when dragging rows to the desktop or a folder to create new files. It’s a perfect demonstration of how “drag effects” can be used for excellent user feedback in your UI. Take a look.
Continue readingYour Very Own Drag Show with JLNDragEffectManager
Cocoa developers were treated to a nice Interface Builder makeover in version 3. One effect we’ve all been admiring is the morphing animation when dragging an item from the Library palette onto a window. It’s actually not too hard and just takes a little showmanship. I’ll show you how it’s done.
Continue readingA Text Field Cell for Totals
Someone asked me how to add visual elements to a text field. This someone had several ideas that were “creative” but bat-shit nuts.
Continue reading