object = DFrame, Bar or BarLayer

object: addButtonImage

DFrame.addButtonImage: Create the default Bar and the default BarLayer if the default Bar if not yet created and create a buttonImage on the default BarLayer of the default Bar.

Bar.addButtonImage: Create a buttonImage on the default BarLayer of the specified Bar.

BarLayer.addButtonImage: Create a buttonImage on the specified BarLayer.

Example

DFrameAPI.preLoadImagesForButtonImage('Close', [filePathForIcons, 'A'],_

close.gif', 'closeOver.gif', close.gif', 'closeOver.gif')

var button = bar.addButtonImage('Close', action,)

Demos

file: addButtonImage.html

Run the example
See the source code

file: addButtons.html

Run the example
See the source code

file: showBarAndButtons.html

Run the example
See the source code

Syntaxes

var button = object.addButtonImage(action, preloadedImages, position)

Parameters

action

String. The Javascript code that will be executed when the Button is activated. See Programming actions for buttons for details about programming those actions.

preloadedImages

The name of a set of images preloaded with the DFrameAPI.preLoadImagesForButtonImage().

position

See position.

Return value

button

ButtonImage object. The new Button.

Usage

Use this method to add a Button to the default Bar of a DFrame or to the specified Bar.

Use addButtonImage if the button is entirely drawn by an image. In the contrary, to create a button with a background color, a background image, edges and text use the addButton method.