This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [RFA] New Event Model Prototype


On Wed, 18 Apr 2001, Jim Ingham wrote:

> I think that the second type is more likely to be what you want. 

I came to the same conclusion. (So I'm not losing my mind.)

> > class MyObject {
> >   inherit GdbEventListener
> >
> >   public method foo {fooEvent} {
> >     puts "varA = [$fooEvent cget -varA]"
> >     puts "varB = [$fooEvent cget -varB]"
> >     puts "varC = [$fooEvent cget -varC]"
> >   }
> > }

I have decided NOT to go this route. Instead, I'm going to use arrays. 
When an event is constructed, it builds an array of all data pertinent to 
itself. Then we ask for this data:

proc handle_foo_event {foo_event} {
  array set fooData [$foo_event get]

  puts "varA = $fooData(varA)"
  puts "varB = $fooData(varB)"
}

Ugh. I thought breakpoints would be easy. Guess again. Can anyone guess 
the difference between clear_command and delete_command (other than 
argument)? I'll give you a hint: using clear_command is EVIL.

Keith


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]