By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,403 Members | 855 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,403 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

--
- Eric Brunel <eric (underscore) brunel (at) despammed (dot) com> -
PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com

Jul 18 '05 #2

P: n/a
Eric Brunel <er*********@despammed.com> wrote in
news:cg**********@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
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.