mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
* Cleanup bundled runtime entry point * Fix JS representation of Screen struct * Expose IsFocused method in Window interface * Update JS window API * Fix cleanup of WML listeners * Bundle runtime as ES module * Update runtime dependencies * Update runtime types and events * Update bundled runtime * Update changelog --------- Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
26 lines
868 B
HTML
26 lines
868 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Title</title>
|
|
<style>body{ text-align: center; color: white; background-color: #191919; user-select: none; -ms-user-select: none; -webkit-user-select: none; }</style>
|
|
</head>
|
|
<body>
|
|
<h1>Events Demo</h1>
|
|
<br/>
|
|
The main program emits an event every 10s which will be displayed in the section below.
|
|
To send an event from this window, click here: <button onclick="wails.Events.Emit({name:'myevent', data:'hello!'})">Send Event</button>
|
|
<div id="results"></div>
|
|
</body>
|
|
|
|
<script type="module">
|
|
import * as wails from "/wails/runtime.js";
|
|
|
|
wails.Events.On("myevent", function(data) {
|
|
let currentHTML = document.getElementById("results").innerHTML;
|
|
document.getElementById("results").innerHTML = currentHTML + "<br/>" + JSON.stringify(data);
|
|
})
|
|
</script>
|
|
|
|
</html>
|