module

UIng

Constants

DEFAULT_SHOULD_QUIT_CALLBACK = ->(_data : Pointer(Void)) : LibC::Int do 0 end

Keep a process-lifetime callback available while replacing a user callback during shutdown. This also protects applications linked against an older libui-ng that does not reset uiOnShouldQuit() during uiUninit().

SOURCE = "https://github.com/kojix2/uing"
VERSION = {{ ((read_file("/tmp/tmp.EGKIJp/src/src/uing/../../shard.yml")).match(/^version:[ \t]*(\S+)/m))[1] }}

Class methods

clear_on_error

Equivalent to on_error(nil).

Source
clear_on_should_quit

Restores the default behavior of rejecting application-wide quit requests. Equivalent to on_should_quit(nil).

Source
handle_callback_error(ex : Exception, ctx : String = "callback")

Handle callback errors by printing the error message and backtrace, then invoking the application-defined policy when one has been configured.

Source
init
Source
init
Source
libui_version

Returns the build identifier reported by the linked libui-ng library. This is diagnostic information, not a complete ABI compatibility check.

Source
main
Source
main_step(wait : Bool) : Bool
Source
main_steps
Source
msg_box(parent, title, description) : Nil

DEPRECATED Use .msg_box on Window instead

Source
msg_box(title : String, description : String) : Nil

Passing NULL is technically valid and handled by all platforms, but it's considered better practice to provide a parent window

Source
msg_box_error(parent, title, description) : Nil

DEPRECATED Use .msg_box_error on Window instead

Source
msg_box_error(title : String, description : String) : Nil

Passing NULL is technically valid and handled by all platforms, but it's considered better practice to provide a parent window

Source
on_error

EXPERIMENTAL

Source
on_error(handler : Nil) : Nil

EXPERIMENTAL

Source
on_should_quit
Source
on_should_quit(callback : Nil) : Nil
Source
queue_main
Source
quit
Source
timer(milliseconds : Int, &callback : -> Bool) : Timer

Schedules a repeating callback on the UI thread at an interval given in milliseconds. Return true to keep running or false to stop.

Source
timer(interval : Time::Span, &callback : -> Bool) : Timer

Schedules a repeating callback on the UI thread. Return true to keep running or false to stop. The interval is rounded up to whole milliseconds because libui-ng accepts only integer milliseconds.

Source
uninit
Source

Nested types