-
Notifications
You must be signed in to change notification settings - Fork 10
Dom.Event
boxgaming edited this page Sep 25, 2023
·
2 revisions
Registers an event handler method that will be triggered when the specified event is fired.
Dom.Event element, eventType$, eventMethod
- The element parameter indicates for which element the event should be registered.
It can be either the object returned from a previous Dom.Create method or Dom.Get method or the String id of the element to remove. - The eventType$ parameter is the name of the event for which the method is being registered (i.e. "click", "change", "mousemove").
- The event method indicates which method or sub should be called when the event is fired.
The sub or function name should be prefixed with "sub_" or "func_" respectively.
Example1: Create a new html BUTTON element and print a message to the main screen canvas when it is clicked.
Dim panel, btn
panel = Dom.Create("div")
btn = Dom.Create("button", panel, "Push Me")
Dom.Event btn, "click", sub_OnButtonClick
Sub OnButtonClick
Print "The button was clicked."
End Sub
Dom.Add Dom.Container Dom.Create Dom.Get Dom.GetImage Dom.Remove