summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tkbgerror.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/tk/lib/tkbgerror.rb')
-rw-r--r--ext/tk/lib/tkbgerror.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/ext/tk/lib/tkbgerror.rb b/ext/tk/lib/tkbgerror.rb
index 8022077a3f..e068155b1c 100644
--- a/ext/tk/lib/tkbgerror.rb
+++ b/ext/tk/lib/tkbgerror.rb
@@ -12,6 +12,16 @@ module TkBgError
end
alias tkerror bgerror
alias show bgerror
-
module_function :bgerror, :tkerror, :show
+
+ def set_handler(hdlr = Proc.new) #==> handler :: proc{|msg| ...body... }
+ tk_call('proc', 'bgerror', 'msg', install_cmd(hdlr) + ' $msg')
+ end
+ def set_default
+ begin
+ tk_call('rename', 'bgerror', '')
+ rescue RuntimeError
+ end
+ end
+ module_function :set_handler, :set_default
end