Ruby 使用 Layout 放置 TkLabel 对象

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

require "tk"

root = TkRoot.new() { title "Today's Date" }
str = Time.now.strftime("Today is \n%B %d, %Y")
lab = TkLabel.new(root) do
        text str
        pack("padx" => 15, "pady" => 10,
             "side" => "top")
      end
Tk.mainloop