1999-08-13 01:37:52 -04:00
|
|
|
#
|
|
|
|
# tkbgerror -- bgerror ( tkerror ) module
|
|
|
|
# 1998/07/16 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
|
|
|
|
#
|
|
|
|
require 'tk'
|
|
|
|
|
|
|
|
module TkBgError
|
|
|
|
extend Tk
|
|
|
|
|
2003-07-23 12:07:35 -04:00
|
|
|
TkCommandNames = ['bgerror'.freeze].freeze
|
|
|
|
|
1999-08-13 01:37:52 -04:00
|
|
|
def bgerror(message)
|
|
|
|
tk_call 'bgerror', message
|
|
|
|
end
|
|
|
|
alias tkerror bgerror
|
|
|
|
alias show bgerror
|
|
|
|
module_function :bgerror, :tkerror, :show
|
2003-06-18 15:46:20 -04:00
|
|
|
|
|
|
|
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
|
1999-08-13 01:37:52 -04:00
|
|
|
end
|