summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tk/radiobutton.rb
blob: e00f0a03eb6384020626fa65b3ca5cf0567d9255 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#
# tk/radiobutton.rb : treat radiobutton widget
#
require 'tk'
require 'tk/button'

class TkRadioButton<TkButton
  TkCommandNames = ['radiobutton'.freeze].freeze
  WidgetClassName = 'Radiobutton'.freeze
  WidgetClassNames[WidgetClassName] = self
  def create_self(keys)
    if keys and keys != None
      tk_call_without_enc('radiobutton', @path, *hash_kv(keys, true))
    else
      tk_call_without_enc('radiobutton', @path)
    end
  end
  private :create_self

  def deselect
    tk_send_without_enc('deselect')
    self
  end
  def select
    tk_send_without_enc('select')
    self
  end
  def variable(v)
    configure 'variable', tk_trace_variable(v)
  end
end
TkRadiobutton = TkRadioButton