Canvas scrolling - scrollBar become "disabled" on change in canvas

A

Askari

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". 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?


I use basic widget (scrollBar, Canvas, Frame, etc.) from library's Tkinter
(and python 2.3.4 on WinXp Pro (sp1))

Askari
 
E

Eric Brunel

Askari said:
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...
 
A

Askari

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...


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 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top