On Wed, Jul 31, 2002 at 06:52:36PM +0100, John Levon wrote: > But this is what happens in the patch,
So I did not read that from the patch. Fine then. > except we don't replicate the code for a map in each inset. There would be one map<action, callback> _per class_. That's not expensive. > Rather an inset expresses an interest in an action, and receives it > when it's fired. It should NOT be receiving any lfun it has no interest > in (why ?) Sure it should not. No registerd handler means "no interest". Actually I don't think the approaches are too different. You have some sort of "global intelligence" which figures out which insets needs to be asked, my approach is just a bit more localized: One loop of potential receivers and the "intelligence" is in the inset. The code actually goes into the inset base and the derived insets only register their handlers. That's fairly minimal I think. > The difference is we do this searching once "statically" by means of the > registration, and you're suggesting we do this dynamically. I don't think > the few cases where we really want dynamic dispatch target finding is > worth doing it every time somebody presses 'a' Well. In general we draw a screenful as response to an 'a'. Insets are nested ... 10 levels? So this is 10 function calls? > Note the post-action thing is used for "well I said I wanted the event, > but I need some clean up". This can deal with both UNDISPATCHED (if > needed) and unlocking (after cursor-right at edge of inset etc.) [This inset locking stuff should go ASAP IMNSHO] In my version an inset would simply shrink the cursor by one level in this case and let the "Right" action intact. Then the parent of the inset sees the "Right" action and does its thing... > > I would not think that we'd need more than 100 or 200 lines for that > > mechanism. > > action.C is 182 lines and has a centralized position for all the dispatch > handling ... Okokok. Then get the "small things" right and I won't complain. Andre' -- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson)