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

Discussion in 'Python' started by Askari, Aug 27, 2004.

  1. Askari

    Askari Guest

    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
     
    Askari, Aug 27, 2004
    #1
    1. Advertising

  2. Askari

    Eric Brunel Guest

    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
     
    Eric Brunel, Aug 30, 2004
    #2
    1. Advertising

  3. Askari

    Askari Guest

    Eric Brunel <> wrote in
    news:cgumjb$bnr$:

    > 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
     
    Askari, Aug 30, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Oz Mortimer

    J2ME scrolling canvas?

    Oz Mortimer, Sep 17, 2003, in forum: Java
    Replies:
    6
    Views:
    8,903
    Darryl L. Pierce
    Sep 19, 2003
  2. Psymaster
    Replies:
    0
    Views:
    396
    Psymaster
    Jul 19, 2003
  3. agb
    Replies:
    1
    Views:
    704
    Chris Angelico
    Jun 22, 2011
  4. Alex

    ScrollBar? Does it exist just WEB ScrollBar Control?

    Alex, Apr 1, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    278
    Alvin Bruney [MVP]
    Apr 4, 2004
  5. pjSoni

    About Image Scrolling with scrollbar

    pjSoni, Feb 6, 2006, in forum: Javascript
    Replies:
    7
    Views:
    109
    pjSoni
    Feb 9, 2006
Loading...

Share This Page