Tuesday, October 30, 2007

Leopard: Fixing the translucent Menu

On Mac OS X Leopard, the top menu is now translucent. I hate it. The effect is especially bad if you use a single color background:



To fix this I needed a very precise desktop background that has a strategically placed white stripe at the top. Processing to the rescue:

int menuHeight=22; // Height of the top Menu
size(1280,854); // size of my PowerBook screen
noStroke();
fill(255);
rect(0,0,width,menuHeight);
fill(58,103,173);
rect(0,menuHeight,width,height-menuHeight);
save("menufix.jpg");

After this runs, use the System preferences to use "menufix.jpg" as your background.

Leopard: Fixing the 3D Dock

Some have complained about the appearance of the Dock on Leopard, and offered a bit of command line magic to fix it.   Below is a shell script to automate the process of turning the dock "shelf" on and off.

When called as "flatdock" you get the non-3D version of the dock;





Called as "3ddock" the shelf is restored:





To install, place the script in your PATH, call it flatdock, make it executable, and then hardlink to 3ddock.



#!/bin/sh
state="YES"
name=`basename $0`
case $name in
3ddock) state="NO";;
flatdock) state="YES";;
esac
defaults write com.apple.dock no-glass -boolean $state
killall Dock

Wednesday, October 10, 2007

Processing...

The Processing Environment is a nice one --- it's quite useful for prototyping graphical and typographical ideas.

The PDE (Processing Development Environment) is a study in simplicity and efficiency -- it abstracts much of the underlying Java-environment, and allows you to simply work with the expected graphical primitives (points, lines, rectangles, ellipses, curves, etc.), and coordinate system, using your own code to control the formation and interaction with the graphic.

I really like PDE -- it works the way you would expect: enter some code, press the run button, the result is displayed -- instant gratification. The environment supports the notion of "sketching" -- (in fact works in progress are called sketches). Want to change a color? tweak an RGB value in the code window, see the results immediately. The same applies to other areas of your graphic like sizes, primitives, loop indices, etc.

A new book on Processing has just been published: Processing: A Programming Handbook
for Visual Designers and Artists
by Casey Reas and Ben Fry. The processing web site has excerpts and all the sample code from the book.