Window

日本語

Window is the top-level container for an application. It owns one child control, so use a layout container when the interface has multiple controls.

Appearance

Window on Ubuntu
Ubuntu
Window on Windows
Windows
Window on macOS
macOS

Runnable example

require "uing"

UIng.init

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

window.child = UIng::Label.new("Hello from UIng")
window.show

UIng.main
UIng.uninit

Usage notes

  • Register on_closing and call UIng.quit to end the event loop.
  • Use margined, content_size, fullscreen, and borderless to control the native window.

API reference · Gallery source