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