CreateToolbarButton

Description

Creates a new button on a toolbar. You can change the format of your toolbar by adding line separators, line breaks, etc. using the CreateToolbarControl command.

Scripting Syntax

CreateToolbarButton( Toolbar, Command, [Index] )

Parameters

Parameter

Type

Description

Toolbar

String

Unique identifier of the toolbar to which the button is added.

Command

String

Unique identifier of the command linked to the new button. You can determine the unique identifier for a command by calling Command.UID.

Index

Integer

Position of the button on the toolbar (0 is the first button, 1 is the second button, and so on; -1 is the last button).

Default Value: -1 (add to end)

Examples

VBScript Example

sub Install()
   dim file, toolbar, command, path

   path = Application.InstallationPath( siUserPath )
   file = path & "\Data\Scripts\myUtils.vbs"

   'Create Toolbar
   toolbar = CreateToolbar("Utilities")

   'Create Commands
   command = CreateScriptCommand( "Simplify It" ,_
                 "makeSimple" ,_
                 file ,_
                 "MakeSimple",_
                 "Makes life easier." )

   'Add button to toolbar.
   CreateToolbarButton toolbar, command
end sub

See Also

CreateToolbar

CreateToolbarControl

CreateScriptCommand

Command.UID



SOFTIMAGE|XSI v6.01     

Return to Softimage XSI Index