~ubuntu-branches/ubuntu/hardy/ruby1.8/hardy-updates

« back to all changes in this revision

Viewing changes to ext/tk/lib/tk/bgerror.rb

  • Committer: Bazaar Package Importer
  • Author(s): akira yamada
  • Date: 2007-03-13 22:11:58 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070313221158-h3oql37brlaf2go2
Tags: 1.8.6-1
* new upstream version, 1.8.6.
* libruby1.8 conflicts with libopenssl-ruby1.8 (< 1.8.6) (closes: #410018)
* changed packaging style to cdbs from dbs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
#  tkbgerror -- bgerror ( tkerror ) module
 
3
#                     1998/07/16 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
 
4
#
 
5
require 'tk'
 
6
 
 
7
module TkBgError
 
8
  extend Tk
 
9
 
 
10
  TkCommandNames = ['bgerror'.freeze].freeze
 
11
 
 
12
  def bgerror(message)
 
13
    tk_call('bgerror', message)
 
14
  end
 
15
  alias tkerror bgerror
 
16
  alias show bgerror
 
17
  module_function :bgerror, :tkerror, :show
 
18
 
 
19
  def set_handler(hdlr = Proc.new) #==> handler :: proc{|msg| ...body... }
 
20
    tk_call('proc', 'bgerror', 'msg', install_cmd(hdlr) + ' $msg')
 
21
  end
 
22
  def set_default
 
23
    begin
 
24
      tk_call('rename', 'bgerror', '')
 
25
    rescue RuntimeError
 
26
    end
 
27
  end
 
28
  module_function :set_handler, :set_default
 
29
end