Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Adding an action to an existing event

 [1/2] from: moeller_thorsten::gmx::de at: 8-Aug-2002 16:34


Hi, first, thanks to Brett for his reply on my last question. Found out what causes the problem. Now i am playing with events. But i have some problems which are not covered by the feel how-to on rebol.com. I have a layout with a grid. When i click into one of the grids fields an action should be taken. The action is no problem and does as it should be. What i am now missing is that the field is marked when i click on it. I looked into the feel-object of the field-style. I found out that the up-action i need for my purpose is not used. how can i add my up-action to the existing engage-event of the field-style whitout writing it completely new? Thorsten

 [2/2] from: brett:codeconscious at: 10-Aug-2002 11:57


Hi Thorsten,
> I looked into the feel-object of the field-style. I found out that the > up-action i need for my purpose is not used. > > how can i add my up-action to the existing engage-event of the field-style > whitout writing it completely new?
The easy part is to say, make a clone the object (so you do not affect normal fields). Engage is just a function. So if it makes sense you could save the old one and write a new one that will do what you want, but call the old one (only if a condition is met perhaps) - in a way chaining them. Maybe this will work for you: stylize/master [ special-field: field with [ feel: make ctx-text/edit [ engage: func [face act event][ either 'up = act [ print "MOUSE UP" ][ ctx-text/edit/engage face act event ] ] ] ] ] view layout [special-field] Brett.