1
0
Fork 0
forked from AbleOS/ableos
ableos/sysdata/programs/sunset_client/src/main.hb

24 lines
831 B
Plaintext
Raw Normal View History

2024-11-10 12:57:48 -06:00
.{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(@unwrap(window)))
if props.position.x != @unwrap(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")
}
}