From 6175ca03be6d0d51359f9017123708987d0f5eb7 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Wed, 15 Aug 2007 23:23:39 +0000 Subject: add tag v1_8_5_91 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_8_5_91@13046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby_1_8_5/ext/tk/lib/tk/scale.rb | 86 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 ruby_1_8_5/ext/tk/lib/tk/scale.rb (limited to 'ruby_1_8_5/ext/tk/lib/tk/scale.rb') diff --git a/ruby_1_8_5/ext/tk/lib/tk/scale.rb b/ruby_1_8_5/ext/tk/lib/tk/scale.rb new file mode 100644 index 0000000000..0b703aa055 --- /dev/null +++ b/ruby_1_8_5/ext/tk/lib/tk/scale.rb @@ -0,0 +1,86 @@ +# +# tk/scale.rb : treat scale widget +# +require 'tk' + +class TkScalevalue) + end + + def configure(slot, value=None) + if (slot == 'command' || slot == :command) + configure('command'=>value) + elsif slot.kind_of?(Hash) && + (slot.key?('command') || slot.key?(:command)) + slot = _symbolkey2str(slot) + slot['command'] = _wrap_command_arg(slot.delete('command')) + end + super(slot, value) + end + + def command(cmd=Proc.new) + configure('command'=>cmd) + end + + def get(x=None, y=None) + number(tk_send_without_enc('get', x, y)) + end + + def coords(val=None) + tk_split_list(tk_send_without_enc('coords', val)) + end + + def identify(x, y) + tk_send_without_enc('identify', x, y) + end + + def set(val) + tk_send_without_enc('set', val) + end + + def value + get + end + + def value= (val) + set(val) + val + end +end -- cgit v1.2.3