>>642,654
モジュールMTKは、任意のウィジェットにID属性を指定できます。
以下のコードでは、Small/Largeボタンを押すと入力テキストのサイズが変化します。

require 'modern_tk'
text_data = Struct.new(:output, :input).new(MTK.variable, MTK.variable)

MTK.mainloop(
  MTK.root(
    :title => 'Ruby/Tk!',
    :vpack => [
      MTK.label(:id => :LABEL, :textvariable => text_data.output),
      MTK.entry(:textvariable => text_data.input, :font => [:serif, 18, [:bold]]),
      MTK.frame(
        :hpack => [
          MTK.button(:text => 'Small', :command => proc { MTK[:LABEL].font.size = 14 }),
          MTK.button(:text => 'Large', :command => proc { MTK[:LABEL].font.size = 18 }),
          MTK.button(
            :text => 'OK',
            :command => proc { text_data.output.value = "You typed #{text_data.input.value} !" }
          )
        ]
      )
    ]
  )
)