• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 5. Using ScriptUI > Defining Behavior for Controls with Event Callbacks

Defining Behavior for Controls with Event Callbacks

You must define the behavior of your controls in order for them to respond to user interaction. You do this by defining event-handling callback functions as part of the definition of the control or window. To respond to a specific event, define a handler function for it, and assign a reference to that function in the corresponding property of the window or control object. Different types of windows and controls respond to different actions, or events:

  • Windows generate events when the user moves or resizes the window. To handle these events, define callback functions for onMove, onMoving onResize, and onResizing (page 164). To respond to the user opening or closing the window, define callback functions for onShow and onClose (page 164).

  • Button, radiobutton, and checkbox controls generate events when the user clicks within the control bounds. To handle the event, define a callback function for onClick (page 177).

  • Edit text, scrollbar, and slider controls generate events when the content or value changes—that is, when the user types into an edit field, or moves the scroll or slider indicator. To handle these events, define callback functions for onChange and onChanging (page 177).


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint