manipulates the font, the size of the label, and colors. : TkLabel « Tk « Ruby






manipulates the font, the size of the label, and colors.

It also provides a Quit button.

#!/usr/bin/env ruby
require 'tk'
TkRoot.new {title "Ruby is fun!" }
TkLabel.new {
  font TkFont.new( 'mistral 42' )
  text "Ruby is fun, in case you didn't notice!"
  width 30
  height 3
  fg 'blue'
  pack
}
TkButton.new {
  text 'Quit'
  command 'exit'
  pack
}
Tk.mainloop

 








Related examples in the same category

1.Add a label to window
2.displays a photo