summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tkentry.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/tk/lib/tkentry.rb')
-rw-r--r--ext/tk/lib/tkentry.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/tk/lib/tkentry.rb b/ext/tk/lib/tkentry.rb
index f35d2eef00c..5207d9b8955 100644
--- a/ext/tk/lib/tkentry.rb
+++ b/ext/tk/lib/tkentry.rb
@@ -59,6 +59,14 @@ class TkEntry<TkLabel
tk_send 'selection', 'to', index
end
+ def validate
+ if tk_send('validate') == '0'
+ false
+ else
+ true
+ end
+ end
+
def value
tk_send 'get'
end