forked from AbleOS/ableos
31 lines
649 B
Plaintext
31 lines
649 B
Plaintext
stn := @use("../../stn/src/lib.hb");
|
|
.{string, memory, buffer} := stn
|
|
|
|
input := @use("../../intouch/src/lib.hb")
|
|
|
|
widgets := @use("widgets.hb")
|
|
|
|
WindowID := struct {
|
|
host_id: int,
|
|
window_id: int,
|
|
}
|
|
|
|
VoidWindowID := WindowID.(0, 0)
|
|
|
|
create_window := fn(channel: int): WindowID {
|
|
// get the horizon buffer
|
|
// request a new window and provide the callback buffer
|
|
// wait to recieve a message
|
|
|
|
windowing_system_buffer := buffer.search("XHorizon\0")
|
|
|
|
if windowing_system_buffer == 0 {
|
|
return VoidWindowID
|
|
} else {
|
|
msg := "\{01}\0"
|
|
msg_length := 2
|
|
|
|
@as(void, @eca(3, windowing_system_buffer, msg, msg_length))
|
|
return WindowID.(1, 0)
|
|
}
|
|
} |