diff options
Diffstat (limited to 'ruby_1_8_6/ext/tk/lib/tkextlib/iwidgets/timefield.rb')
-rw-r--r-- | ruby_1_8_6/ext/tk/lib/tkextlib/iwidgets/timefield.rb | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/ruby_1_8_6/ext/tk/lib/tkextlib/iwidgets/timefield.rb b/ruby_1_8_6/ext/tk/lib/tkextlib/iwidgets/timefield.rb new file mode 100644 index 0000000000..28e1504797 --- /dev/null +++ b/ruby_1_8_6/ext/tk/lib/tkextlib/iwidgets/timefield.rb @@ -0,0 +1,58 @@ +# +# tkextlib/iwidgets/timefield.rb +# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) +# + +require 'tk' +require 'tkextlib/iwidgets.rb' + +module Tk + module Iwidgets + class Timefield < Tk::Iwidgets::Labeledwidget + end + end +end + +class Tk::Iwidgets::Timefield + TkCommandNames = ['::iwidgets::timefield'.freeze].freeze + WidgetClassName = 'Timefield'.freeze + WidgetClassNames[WidgetClassName] = self + + def __boolval_optkeys + super() << 'gmt' + end + private :__boolval_optkeys + + def __strval_optkeys + super() << 'textbackground' + end + private :__strval_optkeys + + def __font_optkeys + super() << 'textfont' + end + private :__font_optkeys + + def get_string + tk_call(@path, 'get', '-string') + end + alias get get_string + + def get_clicks + number(tk_call(@path, 'get', '-clicks')) + end + + def valid? + bool(tk_call(@path, 'isvalid')) + end + alias isvalid? valid? + + def show(time=None) + tk_call(@path, 'show', time) + self + end + def show_now + tk_call(@path, 'show', 'now') + self + end +end |