|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
||||
|
||||
|
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
|
||||
|
||||
|
I *finally* figured it out!
|
|
#3
|
|||
|
|||
|
What was it?
|
|
#4
|
||||
|
||||
|
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. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > Scrollbar problem... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|