added event example
This commit is contained in:
parent
780189a1a6
commit
6c3539fcd5
9 changed files with 249 additions and 31 deletions
|
|
@ -9,8 +9,8 @@ HtmlElement* button = new HtmlElement("myButton"); //prevent destruction
|
|||
|
||||
|
||||
int main() {
|
||||
button->AddClickListener([](){
|
||||
button->AddClickListener([](Crafter::MouseEvent event){
|
||||
auto output = HtmlElement("output");
|
||||
output.SetInnerHTML("Button was clicked!");
|
||||
output.SetInnerHTML("Button was clicked at (" + std::to_string(event.clientX) + ", " + std::to_string(event.clientY) + ")!");
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue