Brightness Menulet (revised)

I’ve taken another swing at making a brightness menulet like the volume menulet. My old version could only toggle brightness (because of UI problems). But the new version is a full on slider!
brightness menulet slider
Here’s the xcode project and intel/ppc builds for at least mac os x 10.5:
Brightness Menulet Xcode Project
Brightness Menulet (intel)
Brightness Menulet (ppc)

Note: This menulet (and the original brightness code) does not work with 10.6 on my Mac Cinema HD display, but it does work with 10.6 on my girlfriend’s MacBook.

Tags: , , , , ,

5 Responses to “Brightness Menulet (revised)”

  1. Steven Goss says:

    Alec,

    Thanks very much for posting this gem. I looked all over trying to find some sample code to put a slider into an NSStatusBar. As our Stereo Receiver has a serial port for inputting commands like volume, or switching its inputs, I’ve been working on some code to control the Receiver from our Apple computers/devices. This code is just the missing piece to allow a volume control to be nicely fit on our Mac’s w/o using a lot of screen space.

    Because I’m still a bit of a newbie (or layman) at Cocoa programming, I’m not quite understanding how you got the Slider Cell linked (or physically located) into the NSMenuItem. Is that done through Interface Builder? I didn’t see anything in the code that was explicitly making this linkage. Can you give me a couple tips on where to look to understand that linkage?

    Thanks again!

    Steven Goss

  2. ajx says:

    Hey Steven,
    I followed this step by step tutorial for making a menulet. Then I changed it to suit my needs. Hope it helps. -A

  3. Steven Goss says:

    Alec,

    Thanks for responding with that post, it seems to be a good tut. However, by the time I had gotten back here to read your post, I had already completed the functionality I needed by just spending a tiny bit more time reading your code. I was able to produce the remote control volume setting OS-X client that I needed. Now I’m onto the iphone/ipad clients which UI will change a bit.

    Best regards,

    Steven

  4. Alex says:

    Hey, nice tutorial. I had trouble with the slider with my macbook’s display set to “Automatically adjust brightness as ambient light changes”. I guess the system would reset the brightness on the fly, and that would trigger the slider to change, etc. Do you know any way around this, other than turning off the automatic setting (it’s the default I think). Thanks!

  5. ajx says:

    Hi Alex, I’m not sure if there is a good way around this. I guess you could put a switch to turn auto brightness on and off right there in the the brightness menulet. That might make it easier.

Leave a Reply