On 11-Feb-09, at 10:07 AM, Michael Carman wrote:
I recently noticed that in one of my applications which uses Tkx::ROText
I could no longer control scrolling via the scrollbars. Explicit calls
to xview() and yview() work but the scrollbar bindings don't. I had to
replace this:

   $hsb->configure(-command => [$rotext, 'xview']);
   $vsb->configure(-command => [$rotext, 'yview']);

with this:

   $hsb->configure(-command => ["$rotext.text", 'xview']);
   $vsb->configure(-command => ["$rotext.text", 'yview']);

The problem (presumably) is that the built-in scrollbar widget is
oblivious to the Perl layer and thus the delegation provided by
_mpath(). It's trying to call yview() on a frame. Fail!

I believe the trick is to make sure the command callback comes through Perl and not stays within the Tcl side. The above command will call the direct Tcl created command for the widget (parent). If you instead use:

-command => sub { $rotext->yview(@_); }

You should get what you need ... I think. It may require some more finessing for the args to be passed along correctly.

Jeff

Reply via email to