Button
Buttonはユーザーのクリックを受けて処理を実行するコントロールです。
表示例
実行例
require "uing"
UIng.init
window = UIng::Window.new("Button Examples", 300, 100, margined: true)
window.on_closing do
UIng.quit
true
end
button = UIng::Button.new("Button") do
on_clicked do
window.msg_box("Information", "You clicked the button")
end
end
button.tooltip = "Click to show a message"
window.child = button
window.show
UIng.main
UIng.uninit
使い方
- クリックは
on_clickedで処理します。 - 共通の
tooltip、enable、disableも利用できます。


