Ability to set handlers.

This commit is contained in:
Stanislav Nikitin 2020-03-23 12:22:37 +05:00
parent 6beb975d81
commit 9ffaaa219e
No known key found for this signature in database
GPG Key ID: 106900B32F8192EE
1 changed files with 5 additions and 0 deletions

View File

@ -56,6 +56,11 @@ func (g *Generic) InitializeGeneric() {
g.initializeInnerItems()
}
// SetHandler sets handler function for specific event.
func (g *Generic) SetHandler(event string, handler func(e *js.Object)) {
g.Object.Set(event, handler)
}
// SetTextContent sets text content for passed object. Note that not
// all HTML elements able to display it.
func (g *Generic) SetTextContent(text string) {