O'Reilly logo

Modding Mac OS X by Erica Sadun

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding a New Button

In this example, you’ll add a new button to the Terminal’s interface that, when clicked, will clear the scrollback within the Terminal window. In order to make room for this new button, you’ll compress the height of the scrollbar.

  1. Close the ContextMenu menu editor if it’s open.

  2. Open the Terminal design window by double-clicking Term in the NIB window.

  3. Select the scrollbar on the right side of the Terminal design window. It appears to the right of the TermSubview. Small, light-blue resize handles appear around the scrollbar. The Info window’s titlebar updates to NSScroller (Custom) Info.

  4. Hold down the Shift key and resize the scrollbar so that it shrinks vertically without changing horizontally. Resize the scrollbar to about half its former size.

  5. Click at the very top of the column (just below the titlebar) to select the split-view button.

  6. Choose Edit Duplicate (⌘-D) to create a new copy of this invisible button.

  7. Drag the invisible button copy down just below the original and watch until the guides (shown in Figure 7-23) appear. These guides ensure that the new button appears just below the original, aligned within the column.

    Watch for these guidebars to appear when you reposition the new button

    Figure 7-23. Watch for these guidebars to appear when you reposition the new button

  8. With the new button selected, open the Attributes pane in the Info window (⌘-1).

  9. In the Attributes pane, check the Bordered box. An outline appears around the new ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required