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

[REBOL] Re: field focus event

From: antonr:iinet:au at: 19-Sep-2003 1:10

I would assume that he meant the button for demo purposes only. (?) I would modify the field (perhaps making a style, if you want multiple fields reacting this way), adding a facet named like: face/focus-action, then modify the focus function to look for that and do it if there is some code there. (Actually, code should be written the other way around, but that is the order of execution, anyway.) ; modfiy the global focus function print mold head insert find/tail second :focus [[hilight-all face]] bind [ ;print [face/offset face/text face/size] if all [in face 'focus-action block? face/focus-action][ ;print "do focus-action" do face/focus-action ] ] fourth second :focus ; (pick out a local word 'face in the func body) ; test with special field view layout [ field "regular field" f: field "special" with [focus-action: [print "hello"]] ] Bindology took some experimenting... :) Tested OK on Rebol/View 1.2.10, 1.2.8, 1.2.5 and 1.2.1. Anton.