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

View File

@ -56,6 +56,11 @@ func (g *Generic) InitializeGeneric() {
g.initializeInnerItems() 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 // SetTextContent sets text content for passed object. Note that not
// all HTML elements able to display it. // all HTML elements able to display it.
func (g *Generic) SetTextContent(text string) { func (g *Generic) SetTextContent(text string) {