From: Jeff Hobbs on
On Jun 4, 4:00 am, swan lee <sl1200...(a)gmail.com> wrote:
> from the doc of the spinbox, abou the -command option :
> Specifies a Tcl command to invoke whenever a spinbutton is invoked.
> The command recognizes several percent substitutions: %W for the
> widget path, %s for the current value of the widget, and %d for the
> direction of the button pressed (up or down).
>
> my goal is to know if up or down button is pressed, but the %d
> substitution return computer-crash (at least ;-) ) value.
> am i right or my code is wrong?

You provide way too few details to indicate any problems, because this
works for me.

(System32) 49 % package require Tk
8.5.8
(System32) 50 % pack [spinbox .s -command { echo %W %d }] -fill both
>>press up button<<
..s up

Jeff
From: swan lee on
my apologies, the %d make me thought bad, i was expecting a 0 or 1.
indeed, it works as expected.

many thanks

> (System32) 49 % package require Tk
> 8.5.8
> (System32) 50 % pack [spinbox .s -command { echo %W %d }] -fill both
>>> press up button<<
> .s up
>
> Jeff

First  |  Prev  | 
Pages: 1 2
Prev: ttk::combobox in "clam" theme
Next: BLT