Pmw ScrolledCanvas: How to scroll to specific item?

MrBlueSky penneys at bigfoot.com
Mon Jun 5 04:34:42 EDT 2006


Hi, I've got a ScrolledCanvas object (sc) and have identified an item
on the canvas to which I wish to scroll.  I've been reading around and
experimenting but with not much success.

So far I've managed to get the item's bbox using sc.bbox(item)
And got the proportion of the canvas that's visible using sc.xview()
and sc.yview()
And established the whole canvas bbox using sc.bbox(ALL)

I've even gone on to use some rudimentary maths to work out whether I
need to scroll, then used:
sc.xview_moveto(itemX)

But this is all rather messy and I've not yet got it working.
There must be an easier way?!

Thanks!

John




More information about the Python-list mailing list