How to simulate action on one button
[1/5] from: ronaldoff::free::fr at: 11-May-2003 1:35
Hello Rebolers,
I'd like to get the same effect as if I had done a mouse click on
one button, but this "action" is originated from script itself.
How is that possible ?
--
Best regards,
ronaldoff
[ronaldoff--free--fr]
[2/5] from: carl::cybercraft::co::nz at: 24-Dec-2003 22:17
On 11-May-03, ronaldoff wrote:
> Hello Rebolers,
> I'd like to get the same effect as if I had done a mouse click on
> one button, but this "action" is originated from script itself.
> How is that possible ?
The following shows a couple of ways to do this. It just depends on
what you want...
view layout [
b: button "Test" [print "Test pressed"]
button "In" [b/state: true show b]
button "Out" [b/state: false show b]
a: button "Action" [
b/feel/engage :b 'down none
b/feel/engage :b 'up none
a/state: false show a ; Not sure why this line is needed...
]
]
The "Action" button probably gives you the effect you want, but I'm
not sure if it's the best way to do it. If the final line is missing
the "Action" button itself stays down for reasons I don't understand,
though it's maybe because it's sharing the engage function.
Hope this is of some help, anyway.
--
Carl Read
[3/5] from: greggirwin:mindspring at: 10-May-2003 21:12
Hi Ronald,
r> I'd like to get the same effect as if I had done a mouse click on
r> one button, but this "action" is originated from script itself.
If you create a reference to the face (e.g. my-btn: button), then you
can do this:
click-face: func [face][
face/feel/engage face 'down none
]
-- Gregg
[4/5] from: ronaldoff:free at: 11-May-2003 14:59
Hello Gregg and Carl, and all of you Rebolers,
You both gave me the way to solution, thanks a lot.
I'm always amazed by the responsivity of this mailing list, and that's
one of the reasons that make me love Rebol programming.
Thanks for your kindness and for all the shared scripts, tips and
advises that you provide.
Go on guys,
...et vive la Rebolution
Sunday, May 11, 2003, 5:12:05 AM, vous avez écrit :
GI> Hi Ronald,
r>> I'd like to get the same effect as if I had done a mouse click on
r>> one button, but this "action" is originated from script itself.
GI> If you create a reference to the face (e.g. my-btn: button), then you
GI> can do this:
GI> click-face: func [face][
GI> face/feel/engage face 'down none
GI> ]
GI> -- Gregg
--
Best regards,
Ronald GRUSS
[ronaldoff--free--fr]
[5/5] from: ljurado:bariloche:ar at: 11-May-2003 17:06
Another way:
view layout [
b: button "Test" [print "Test pressed"]
button "Action 2" [b/action b none]
]
Luis