From: Michael Kelly Date: 2005-08-05T23:06:06+09:00 Subject: Re: Question about WIN32OLE_EVENT. Tried that a couple of different ways: @documentEventHandlers.each_value { |value| value.on_event( 'onclick' ) {} } and @documentEventHandlers.each_value { |value| value.on_event {} } But neither seemed to detach the event. -=michael=- -----Original Message----- From: Dave Burt [mailto:dave@burt.id.au] Sent: Friday, August 05, 2005 2:51 AM To: ruby-talk ML Subject: Re: Question about WIN32OLE_EVENT. "Michael Kelly" wrote... > So, I'm clear on how to attach to events: > > @ie = WIN32OLE.new( 'InternetExplorer.Application' ) > browserEvents = WIN32OLE_EVENT.new( @ie, 'DWebBrowserEvents2' ) > browserEvents.on_event { |*args| eventHandler( *args ) } > > But how does one detach from events? # Replace the current event handler with an empty one: browserEvents.on_event {} > I'm working on a little utility that will generate Watir scripts using > IE automation. ... Let us know - that sounds really useful! Cheers, Dave