|
Pages: [1]
|
 |
|
Author
|
Topic: /View event handling? (Read 376 times)
|
|
yeksoon
|
I am trying to find some documentation for event handling in /View.
Some simple things that I am looking for.
eg. view layout [ price: field cost: field net_amt: field
]
what I want to look for is when user key in data in fields price and cost... and once the user tab to go to the last field, it should do some calculation and assinged the result to "net_amt".
I don't seems to find docs on event handling on RT's site.
Any links or examples. Thanks
|
|
|
|
|
Logged
|
|
|
|
|
CarlRead
|
The contents of a block after FIELD will be evaluated when the user presses Tab (or Enter or just exits the field), so you can use that to have the third field automatically updated. ie, with something like this... calc-net: func [][ if error? try [p: to-decimal price/text][p: 0] if error? try [c: to-decimal cost/text][c: 0] net-amt/text: to-string p + c show net-amt ] view layout [ price: field [calc-net] cost: field [calc-net] net-amt: field ] For more complex event-handling, the User Interface Events "How-to" (here: http://www.rebol.com/how-to.html ) goes into quite a bit of detail. Hope that helps.
|
|
|
|
|
Logged
|
- Carl Read
|
|
|
|
|
Pages: [1]
|
|
|
 |