diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-08-09 06:44:45 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-08-09 06:44:45 +0000 |
commit | 303dc3c591e324b6bbc691326d8bea76fe3b8fda (patch) | |
tree | 51d384de3922135bc42514af63da8aa4587a44cb /ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb | |
parent | f82df94f390a104be47b57e45801409be23954a9 (diff) |
* ext/tk: Tk is removed from stdlib. [Feature #8539]
https://github.com/ruby/tk is the new upstream.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb')
-rw-r--r-- | ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb b/ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb deleted file mode 100644 index 2e64bdfb08..0000000000 --- a/ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: false -require 'tk' -require 'tkextlib/iwidgets' - -class Spinner_demo < TkWindow - Months = %w(January February March April May June July August September October November December) - - def block_input(c) - false - end - - def spin_month(step) - index = Months.index(@spinner.get) + step - index = 11 if index < 0 - index = 0 if index > 11 - - @spinner.value = Months[index] - end - - def initialize(parent=nil) - @spinner = Tk::Iwidgets::Spinner.new(parent, :labeltext=>'Month : ', - :width=>10, :fixed=>10, - :validate=>proc{|c| block_input}, - :decrement=>proc{spin_month -1}, - :increment=>proc{spin_month 1}) - @path = @spinner - @spinner.insert(0, Months[0]) - end -end - -Spinner_demo.new.pack(:padx=>10, :pady=>10) - -Tk.mainloop |