Attaching a function to a button in the tabs – Apple Shake 4 User Manual

Page 376

Advertising
background image

376

Chapter 14

Customizing Shake

This calls the alternative icon set, which concentrates more on the name of the
function. The alternative icons are stored in icons/fxAlt, with the same name as the
normal icons set, for example, Image.Average.nri, and so on. The dimensions for these
icons are 130 x 26. Because they are wider, you typically limit the columns to five in a
normal Shake environment. For a macro on generating these icons, see “

MakeNodeIcon

Macro

” on page 998. You can activate the icons in two places, either a startup file, or by

uncommenting the following two bold lines in the nrui.h file:

//These control the color of text on an inactive tab
gui.tabber.tint.red = .65;
gui.tabber.tint.green = .65;
gui.tabber.tint.blue = .63;
//gui.doBoxAltFxIcons = 1;
//gui.doBoxColumns = 5;

nuiPushMenu(“Tools”);
nuiPushToolBox(“Image”);

nuiToolBoxItem(“Average”, “ const char *fileName = blah blah blah
nuiToolBoxItem(“Checker”, Checker());

...

Attaching a Function to a Button in the Tabs

In the ui directory:

nuiPushToolBox(“Image”);
nuiToolBoxItem(“Flock”, Flock(0,0,0));
nuiPopToolBox();

This places an icon that you have created into a tab that you assign. In this example,
the icon is placed in the Image tab. If you use a custom name, such as My_Macros, it
creates that tab. The second line first attaches the icon, and then assigns the function
with its default arguments to that button. They do not have to be the same name, but
both are case sensitive. The icon is either found in <ShakeDirectory>/icons, your
$HOME/nreal/icons, or in any directory pointed to with $NR_ICON_PATH. The icons have
the following characteristics:

Although they can be any size, the standard resolution is 75 x 40 pixels.

Do not use an alpha channel. Assign a SetAlpha (set to 0) or Reorder (set to rgbn) to
remove the alpha channel.

Advertising