Canvas scrolling - scrollBar become "disabled" on change in canvas
Askari
askari at addressNonValide.com
Mon Aug 30 10:56:21 EDT 2004
Eric Brunel <eric_brunel at despammed.com> wrote in
news:cgumjb$bnr$1 at news-reader3.wanadoo.fr:
> Askari wrote:
>> Hi,
>> I do a "perso"widget where have two scrolls (one vertical, one
>> horizontal) for a canvas.
>> When, the first time, I added widget in the canvas, the scroll
>> self-ajust and when I move scrollbar, the surface's canvas "moved".
>
> Well... It shouldn't... The only way to make the scrollable area
> larger is by using theCanvas.configure(scrollregion=(x1, y1, x2, y2));
> adding items into the canvas should have no effect at all on it...
>
>> But when I deleted
>> (.destroy) this first widgets and that a added other widget, the
>> scrollBar become disabled (ajust for no scroll on the canvas).
>> What/where is the problem?
>
> Can you please post some (simple) code that shows this behaviour?
> Without a clear idea about what you're doing, it will be quite
> difficult to help you...
>
>> I use basic widget (scrollBar, Canvas, Frame, etc.) from library's
>> Tkinter (and python 2.3.4 on WinXp Pro (sp1))
>>
>> Askari
I try self.cv.config(scrollregion=self.cv.bbox(ALL)) but, not success. But
I find that when I resize a parent's canvas or when I move the "view" on
canvas (e.g. the other scrollBar not disabled), the anormal scrollBar
become normal...
so, I fix my problem with this lines :
self.cv.yview('moveto', '1')
self.cv.yview('moveto', '0')
It's a stupid fix, but it work! :-)
Sorry, I can't send you some code because it's minimum (if I remove
comments) 200 lines... and 100 if I wrap the not important code...
Askari
More information about the Python-list
mailing list