Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

setSoftkeyIcon

Description

Sets an image object to display at the top left corner of the softkey. Useful for indicating a hard key that calls the same handler. Suggested image size is 5x5 pixels.


Basic Example: 

 

Code Block
languagejs
 exampleObj.setSoftkeyIcon(keyNum, icon);

 

If you require the app library, you can use Digium's set of softkey icons. These image objects are created when the library is required.

  • app.images.softKeys.left (left arrow)
  • app.images.softKeys.right (right arrow)
  • app.images.softKeys.up (up arrow)
  • app.images.softKeys.down (down arrow)
  • app.images.softKeys.select (check mark)
  • app.images.softKeys.cancel (X)

Parameters

 

NameRequiredTypeDefaultDescription
keyNum
Yes
integer
 

Softkeys are labeled 1-4.

icon
Yes
widget
 

Instance of a image widget for display.

 

Examples

setSoftkeyIcon to set icons for the softkeys: Digium up arrow, Digium checkmark, custom icon

Code Block
languagejs
testWidget.setSoftkeyIcon(1, app.images.softKeys.up);
testWidget.setSoftkeyIcon(2, app.images.softKeys.select);
 
var imgWidget = new Image("app", "smileyface.png", 0, 0, 5, 5);
testWidget.setSoftkeyIcon(3, imgWidget);
  1.