Peter Ryskin
08-11-2004, 10:39 PM
So the script I've done is finished in its raw form, and I want to wrap it it a nice UI - because the 20+ parameters are getting out of hand, haha.
No problemo, a fast little macroscript wrapper will do the trick, and its shaping up nicely.
I got a couple of spinners. I would like to be able to distinguish between mouse-operations (ie. fiddle your value and press a button when done) and direct keyboard input - type a number, hit enter. No sweat - according to the documentation (5.1) the spinner on entered do event only fires on leaving the input field;
on <spinner> entered do <expr>
Called when the user types a number into a spinners edit field and then presses ENTER or presses TAB to move the cursor out of the field. The on <spinner> changed handler, if supplied, has already been called at this point and the spinner's value property is up to date.
as seen opposed to
on <spinner> changed <arg> do <expr> Called when the user spins the spinner, or when the user enters a value in the spinner field then presses ENTER or presses TAB to move the cursor out of the field. The <arg> argument will contain the newvalue of the spinner.
But ah - Nu uh, it fires on every damn click on the spinners /cry And no, I'm not entering the field and then clicking a spinner (which while a flawed implementation would hold up against the documentation ;p) . Anyone got a workaround for it ?
No problemo, a fast little macroscript wrapper will do the trick, and its shaping up nicely.
I got a couple of spinners. I would like to be able to distinguish between mouse-operations (ie. fiddle your value and press a button when done) and direct keyboard input - type a number, hit enter. No sweat - according to the documentation (5.1) the spinner on entered do event only fires on leaving the input field;
on <spinner> entered do <expr>
Called when the user types a number into a spinners edit field and then presses ENTER or presses TAB to move the cursor out of the field. The on <spinner> changed handler, if supplied, has already been called at this point and the spinner's value property is up to date.
as seen opposed to
on <spinner> changed <arg> do <expr> Called when the user spins the spinner, or when the user enters a value in the spinner field then presses ENTER or presses TAB to move the cursor out of the field. The <arg> argument will contain the newvalue of the spinner.
But ah - Nu uh, it fires on every damn click on the spinners /cry And no, I'm not entering the field and then clicking a spinner (which while a flawed implementation would hold up against the documentation ;p) . Anyone got a workaround for it ?
