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

[REBOL] Re: Event redirection within face hierachies

From: antonr:lexicon at: 21-Jun-2004 1:18

Try out this simple redirection: view layout [ b: button "hello" button "there" feel [ engage: func [face action event][ b/feel/engage b event/type event ] ] ] And here is a little doc I made (and will put on my rebsite later): Event datatype breakdown: event/1 event/type event/2 event/key event/3 event/offset event/4 event/time event/5 event/shift event/6 event/control event/7 event/face event/8 event/double-click You can spoof or emulate an event! by creating a block and putting the relevent data in the correct positions, eg. my-event: reduce ['down none 20x20 now/time/precise none none face none] Most view functions won't know the difference because they don't check to see if it's really an event datatype. Here's a way that should respond to both the "indexed" access method (ie. event/3) and the "named select" access method ie. (event/offset): event: reduce [none none 30x30 none none none none none 'offset 30x30] This block has all the 8 values in the first 8 positions, and following that, a name/value pair [offset 30x30]. If a function expecting an event! gets the above block instead, it may get the offset through the path: event/3 or via the path: event/offset Anton.