ableos/sysdata/programs/sunset_client/src/main.hb
2024-11-10 19:37:37 +00:00

24 lines
813 B
Plaintext

.{log, string} := @use("../../../libraries/stn/src/lib.hb")
sunset := @use("../../../libraries/sunset_proto/src/lib.hb")
main := fn(): void {
sunset.client.init()
log.info("client: request new window\0")
window := sunset.client.new_window(.(.(100, 100), .(150, 150), "Hello, World!\0"))
if window == null {
log.error("Could not create window\0")
return
}
log.info("client: window created. title:\0")
log.info(window.props.title)
window.props.position = .(500, 500)
props := @unwrap(sunset.client.update_window_props(window))
if props.position.x != window.props.position.x {
log.error("client: we did not update props\0")
}
log.info("client: sending shutdown request\0")
shutdown := sunset.client.request_shutdown()
if shutdown == null {
log.error("client: didnt shutdown the server\0")
}
}