Group Abstract Group Abstract

Message Boards Message Boards

0
|
1.3K Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Continuously display variables value within EventHandler

Posted 1 year ago

Consider this code:

DynamicModule[{cnt = 0}, Dynamic@ EventHandler[Dynamic[cnt], "MouseDown" :> (While[CurrentValue["MouseButtons"] == {1}, cnt++])]]

I want this code to continuously displays the value of "cnt", as it changes, on mousedown. Currently it displays only the final value when the mousebutton is released. Could somebody please tell me.

3 Replies
Posted 1 year ago

Neat. I was carried away by the elegant implementation of the "While" loop approach. Your solution is a simple fix. Thanks.

Posted 1 year ago

I wish it were my solution. It was the user Domen who always gives great answers.

POSTED BY: Jim Baldwin
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard