#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    67
    Rep Power
    11

    Scrollbar problem...


    I am trying to attach a scollbar to a text field. This is the code I am using:
    Code:
            self.scrollbar = Scrollbar(master, orient=VERTICAL)
            self.scrollbar.pack(side=RIGHT, fill=Y)
            self.text = Text(master, height=5, width=20, state=DISABLED, yscrollcommand=self.scrollbar.set)
            self.text.grid(row=2, column=1, rowspan=2)       
            self.scrollbar.config(command=self.text.yview)
    When I run the program, the program freezes and I have to Ctrl-Alt-Delete put of it. What's wrong?
    Thanks in advance.
    Before you criticize someone, walk a mile in their shoes, that way when you do criticize them, you're a mile away and you have their shoes!
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    67
    Rep Power
    11
    I *finally* figured it out!
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Yuma,AZ
    Posts
    11
    Rep Power
    0
    What was it?
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    67
    Rep Power
    11
    This is my new code:
    Code:
            self.text = Text(master, height=5, width=20, state=DISABLED)
            self.scroll = Scrollbar(master, command=self.text.yview)
            self.text.configure(yscrollcommand=self.scroll.set)
            self.text.grid(row=2, column=1, rowspan=2)       
            self.scroll.grid(row=2, column=1, rowspan=2, sticky=E)
    Basically, I added self.scroll.grid and put it in the same grid postion as the text box.
    Before you criticize someone, walk a mile in their shoes, that way when you do criticize them, you're a mile away and you have their shoes!

IMN logo majestic logo threadwatch logo seochat tools logo