On May 31, 2017, at 1:42 AM, Matthias Hofer <ma...@the-lions.org> wrote:
> I'm using Tkx for my nice interface, and so far things work great.
> 
> But I don't get to work a specific thing I need to do: In "scale.tcl", there 
> are bindings like
> 
>    bind TScale <ButtonPress-1>   { ttk::scale::Press %W %x %y }
> 
> I'd like to change that in my Perl program to
> 
>    bind TScale <ButtonPress-1>   { ttk::scale::Jump %W %x %y }
> 
> I can't figure out how to execute the latter command via Tkx in Perl. Tkx::Ev 
> does only work for one argument, but here three are expected.

I believe http://www.tkdocs.com/tutorial/concepts.html points in the right 
direction. Doing this completely blind, but I think it would look like:

Tkx::bind(“TScale”, “<ButtonPress-1>”, [sub { my($W, $x, $y) = @_;
      # insert action here
}, Tkx::Ev(“%W”, "%x", "%y")]);

but it looks like you just want to use pure Tcl actually, so that is more 
simply:

Tkx::bind(“TScale”, “<ButtonPress-1>”, “ttk::scale::Jump %W %x %y”);

Jeff

Reply via email to