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

2019-06-16 02:08栏目:技术创新

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

版权声明:本文由新浦京娱乐站_新浦京娱乐场官网_新浦京娱乐发布于技术创新,转载请注明出处:manipulates the font, the size of the label, and colors.