Code attack!

Over the weekend I managed to get some more coding in (though as usual, not as much as I’d have liked). So here’s a post about that:

Miscellaneous Projects: I decided I’d better make a home for all of my little projects. So now they all have a spot on my miscellaneous projects page. And of course since no page would be complete with out the obligatory picture, I made a question-mark-in-a-package icon to keep them company, cool eh?

CTBadge: I knew when I started it that I’d eventually have to ditch the ripping of’s badge images for my own purposes. And after some suggestion I decided to make eventually now. It turned out making ‘counterfeits’ was actually not that bad… started up Illustrator, and a little while later (after finding the Zig-Zag Filter) I had vector (I love vector!) replicas of Mail’s raster badges.

I can't tell the difference

I can’t tell the difference

So now, thanks to the vector masks, CTBadge will get you renders of badges at any size, and also allows you to set the label and badge colors to what ever you’d like (while retaining the classy shading at the lower right corner – beautiful!).

And while all that is swell (and it is) I still wonder if letting people choose any color that they’d like for their badges is a good thing, I’ll rue the day when I see electric purple badges on my dock… but alternatively colored badges have their place I suppose – so there you go. (Though I sure hope people have a darn good reason for not using the classic white on red when they do – and “it looks better” doesn’t quite do it, but I suppose that’s just me).

CTGradient: Now it has a method to do a radial fill. After putting off including the code for a while, I finally settled on the implementation I preferred, which was leaving axial/radial specifics in the drawing methods where they belong – and not as a part of the instance. Though a few questions still remain – as I have it now, it draws so the gradient progresses from the center to the outermost edge, would there ever be a reason to have it progress to either the nearest edge or even off to the corner? meh, it’s good enough for now.

I also finished implementing all the boring parts of CTGradient, that is, I finally implemented the NSCopying and NSCoding protocols, and also added some extra accessor methods, documentation, and #pragma’s to the source.

CTTabView: This a new project I’ve started work on, a view designed for doing more of a “Tabbed Views” sort of thing (like Safari/Adium/Firefox) than the “View with Tabs” thing that NSTabView does (and does well). Other people have made things like it… but none have really caught my fancy.

Well, that’s enough for now – I’ll save the rest for a later post.

3 Responses to “Code attack!”

  1. Jeff Nouwen says:
    Though I sure hope people have a darn good reason for not using the classic white on red when they do

    I agree that for a single badge on your app that it should be the “standard” red on white badge; but I know one example where having multiple colours (and even shapes) is beneficial: when you want to display more than one badge. A perfect example is DockStar

  2. So a few things:

    svn co PSMTabBarControl

    2) We’re going to try a new look for the badge for Feed (which will ship with Growl). You might want to take a look:

    screenie: Find the source:

  3. Pepa says:

    Heya Alan,Cheers!! I just wanted to work with a name from beinhd an alias I can express myself from a blank slate with no baggage and truely say what I have/want to say at that time. It also allows the music to speak louder than the person which is what I want to do! And I like the word! =)Shauna

Leave a Reply