Add a label to window : TkLabel « Tk « Ruby






Add a label to window


#!/usr/bin/env ruby

require 'tk'
hello = TkRoot.new
TkLabel.new( hello ) do
    text "\n  Hello, Matz!  \n"
    pack
end
Tk.mainloop

 








Related examples in the same category

1.manipulates the font, the size of the label, and colors.
2.displays a photo