WebUI Wrapper
- Posted by Icy_Viking 2 days ago
- 88 views
Hi all,
I have made a wrapper for WebUI! WebUI let's you use webview or a web browser as GUI!
[https://github.com/webui-dev/webui/tree/main]
Wrapper [https://github.com/gAndy50/EuWebUI]
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Simple Test</title>
<b> Hello World! </b>
<br>
<script src="webui.js"></script> <!-- Required -->
</head>
<body>
<button id="exitBtn">Exit</button>
<script>
// Use WebUI's built-in JS bridge
document.getElementById("exitBtn").addEventListener("click", function() {
webui.call("close_app"); // This triggers the Euphoria callback
});
</script>
</body>
</html>
include std/ffi.e include std/machine.e include webui.e public function close_app() webui_exit() puts(1,"Closing...\n") return 0 end function atom close_id = routine_id("close_app") object close_cb = call_back(close_id) public procedure main() atom win = webui_new_window() webui_bind(win,"close_app",close_cb) webui_set_center(win) webui_show(win,"index.html") webui_wait() webui_clean() end procedure main()

