1# 2# tkextlib/iwidgets/spintime.rb 3# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) 4# 5 6require 'tk' 7require 'tkextlib/iwidgets.rb' 8 9module Tk 10 module Iwidgets 11 class Spintime < Tk::Itk::Widget 12 end 13 end 14end 15 16class Tk::Iwidgets::Spintime 17 TkCommandNames = ['::iwidgets::spintime'.freeze].freeze 18 WidgetClassName = 'Spintime'.freeze 19 WidgetClassNames[WidgetClassName] ||= self 20 21 def __boolval_optkeys 22 super() << 'houron' << 'militaryon' << 'minutelabel' << 'secondlabel' 23 end 24 private :__boolval_optkeys 25 26 def __strval_optkeys 27 super() << 'hourlabel' << 'minuteon' << 'secondon' 28 end 29 private :__strval_optkeys 30 31 def get_string 32 tk_call(@path, 'get', '-string') 33 end 34 alias get get_string 35 36 def get_clicks 37 number(tk_call(@path, 'get', '-clicks')) 38 end 39 40 def show(date=None) 41 tk_call(@path, 'show', date) 42 self 43 end 44 def show_now 45 tk_call(@path, 'show', 'now') 46 self 47 end 48end 49