OSDN Git Service

26f20234cadb33ec8a112a9fc2e8169a7f53569b
[pf3gnuchains/pf3gnuchains4x.git] / gdb / gdbtk / library / ehandler.itb
1 # GDBEventHandler class implementation for Insight.
2 # Copyright (C) 2001 Red Hat, Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify it
5 # under the terms of the GNU General Public License (GPL) as published by
6 # the Free Software Foundation; either version 2 of the License, or (at
7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14 # ------------------------------------------------------------
15 #  PUBLIC PROC:  dispatch - Dispatch the given event to all
16 #                 event handlers. The name of the handler
17 #                 method to call is stored in the event's
18 #                 "handler" method.                  
19 # ------------------------------------------------------------
20 itcl::body GDBEventHandler::dispatch {event} {
21
22   set handler [$event handler]
23
24   # invoke event handlers
25   foreach w [itcl::find objects -isa GDBEventHandler] {
26     dbug I "posting event \"$handler\" to \"$w\""
27     if {[catch {$w $handler $event}]} {
28       dbug E "On $handler event, $w errored:\n$::errorInfo"
29     }
30   }
31 }