Method: TkTimer#do_callback

Defined in:
lib/tk/timer.rb

#do_callbackObject

instance methods



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/tk/timer.rb', line 70

def do_callback
  @in_callback = true
  @after_id = nil
  begin
    @return_value = @current_proc.call(self)
  rescue SystemExit
    exit(0)
  rescue Interrupt
    exit!(1)
  rescue Exception => e
    if @cancel_on_exception &&
        @cancel_on_exception.find{|exc| e.kind_of?(exc)}
      cancel
      @return_value = e
      @in_callback = false
      return e
    else
      fail e
    end
  end
  if @set_next
    set_next_callback(@current_args)
  else
    @set_next = true
  end
  @in_callback = false
  @return_value
end