1 # GDBEventHandler class implementation for Insight.
2 # Copyright (C) 2001 Red Hat, Inc.
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.
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.
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
19 # ------------------------------------------------------------
20 itcl::body GDBEventHandler::dispatch {event} {
22 set handler [$event handler]
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"