Label

日本語

Label displays non-editable text.

Appearance

Label on Ubuntu
Ubuntu
Label on Windows
Windows
Label on macOS
macOS

Runnable example

require "uing"

UIng.init

window = UIng::Window.new("Label Example", 300, 100, margined: true)
window.on_closing do
  UIng.quit
  true
end

label = UIng::Label.new("This is a label.")
label.font_size = 24

window.child = label
window.show

UIng.main
UIng.uninit

Usage notes

  • Update the caption with text=.
  • Set font_size for a custom size and call reset_font_size to restore the native default.

API reference · Gallery source