aboutsummaryrefslogtreecommitdiffstats
path: root/ext/tk/lib/tkextlib/iwidgets/timefield.rb
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-07-09 19:29:29 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-07-09 19:29:29 +0000
commite55330c9c415f673ca5565a9dbd0b84775d53419 (patch)
treeab1c6145288ce3d209e605fe3dbc10c66f487f2f /ext/tk/lib/tkextlib/iwidgets/timefield.rb
parent29c3cb6d2061d2d476ef50066b44a5596dd51d99 (diff)
downloadruby-e55330c9c415f673ca5565a9dbd0b84775d53419.tar.gz
* ext/tk/lib/tk.rb: better operation for SIGINT when processing callbacks.
* ext/tk/lib/tk/msgcat.rb: ditto. * ext/tk/lib/tk/variable.rb: ditto. * ext/tk/lib/tk/timer.rb: ditto. * ext/tk/lib/tk/validation.rb: add Tk::ValidateConfigure.__def_validcmd() to define validatecommand methods easier git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tkextlib/iwidgets/timefield.rb')
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/timefield.rb43
1 files changed, 43 insertions, 0 deletions
diff --git a/ext/tk/lib/tkextlib/iwidgets/timefield.rb b/ext/tk/lib/tkextlib/iwidgets/timefield.rb
new file mode 100644
index 0000000000..602093eb7e
--- /dev/null
+++ b/ext/tk/lib/tkextlib/iwidgets/timefield.rb
@@ -0,0 +1,43 @@
+#
+# 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 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