FontButton
FontButtonはOS標準のフォント選択画面を開き、FontDescriptorを返します。
表示例
実行例
require "uing"
UIng.init
window = UIng::Window.new("FontButton Example", 300, 100, margined: true)
window.on_closing do
UIng.quit
true
end
font_button = UIng::FontButton.new do
on_changed do |font_descriptor|
window.msg_box("Font Changed", "Family: #{font_descriptor.family}\nSize: #{font_descriptor.size}")
end
end
window.child = font_button
window.show
UIng.main
UIng.uninit
使い方
- 新しい選択は
on_changedで処理します。 - 記述子はコールバック内、またはブロック形式の
fontヘルパー内で使用します。


