Copyright 2008 Shoptalk Systems

IMAGEBUTTON #handle, urlExpr$, handler

The IMAGEBUTTON statement adds a button object to the web page at the current position.  The button object is assigned to the variable named #handle.  The urlExpr$ is used to find a graphics file from the Run BASIC web server.  By default it will look in the resources folder specified on the Preferences tab.  The handler is either the name of a branch label, or the name of a sub.

When the button is clicked, the name of the handle variable is assigned to the global variable EventKey$.  If the handler is a named sub, then the name of the handler is passed into the sub as a string parameter.

Example:

  'add a button which will call a branch label
  imagebutton #open, "/openbutton.png", [openClicked]
  'add a button which will call a scoped subroutine
  imagebutton #save, "/savebutton.png", saveClicked
  print
  wait

[openClicked]
  print "Open was clicked!"
  print EventKey$
  wait

sub saveClicked handle$
  print "Save was clicked!"
  print handle$
  print EventKey$
end sub

IMAGEBUTTON object methods

#handle CSSCLASS() - Set the CSS class tag
#handle SETKEY(stringExpr$) - Set the link's event key to stringExpr$
#handle SETID(expr$) - Set the HTML id property to be the value of expr$
#handle TOOLTIP(expr$) - Set a tooltip for the imagebutton using the value of expr$
#handle ISNULL() - Returns zero (or false)
#handle DEBUG$() - Returns the string "Link"