#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    3
    Rep Power
    0

    problems scrolling in text areas


    I am having problems using the scrollbar in a text box. When I create the scrollbar the text area shrinks in size, and even when I try to resize the text area, it remains the same. Here is the code!

    scrollText1 = Scrollbar(self.text1)
    scrollText1.config(command = self.text1.yview)
    self.text1.config(yscrollcommand = scrollText1.set, height = 15, width = 85)
    scrollText1.pack(side = RIGHT, fill = Y)

    self.text1.grid(column = 1, row = 2, sticky = N+E+S+W)

    self.text1 is previously declared. Any suggestions would be very appreciative

    Thanks!
  2. #2
  3. Mini me.
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Location
    Cambridge, UK
    Posts
    783
    Rep Power
    13
    Personally I use the scrolled text widget:

    from ScrolledText import ScrolledText
    self.text = ScrolledText(self.parent)

    When you say shrinks in size - what exactly happens?

    grim
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    3
    Rep Power
    0
    without the scrollbar the text area is 15 lines,
    when i declare a scrollbar to accompany the text area, it shrinks to 6 lines, even when the text area is declared to be larger. This happens no matter where the configuration for the text area is stated.

    Thanks for the help though, I will probably change my code to use your suggestion if I can't figure it out soon.

    Thanks again!

    Liz
  6. #4
  7. Mini me.
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Location
    Cambridge, UK
    Posts
    783
    Rep Power
    13
    The scrollbar needs a container as a parent (Frame,Window), a text box is not enough it seems. If you set the scrollbars parent to be the containing frame the text box should size correctly.

    grim

IMN logo majestic logo threadwatch logo seochat tools logo