scrollbar

Lee Harr missive at frontiernet.net
Wed Apr 16 19:22:20 EDT 2003


In article <b7kh3g$51u$1 at nemesis.news.tpi.pl>, zyziu wrote:
> Hello. I made lanChat in Python. I have problem with Text widget. I want to
> text from Entry goes to Text widget and scrollbar goes down, because I can't
> see what write another user. Now I must do it manually. How do it to
> scrollbar goes down automatically? Thanks for answer. Zyziu from Poland.
> 
> 

You should probably be a little bit more specific, and maybe include
some of the code around where you are having the problem.

That said, if this is Tkinter, maybe something here will help:


      self.wout = Tkinter.Tk()
      self.frame = Tkinter.Frame(self.wout, bg='brown')


      self.frame.sc = Tkinter.Scrollbar(self.frame, orient=Tkinter.VERTICAL)

      self.frame.tout = Tkinter.Text(self.frame, yscroll=self.frame.sc.set,
					 bg='black', fg='white')

      self.frame.sc['command'] = self.frame.tout.yview
      self.frame.sc.pack(side='right', fill='y')


         t = self.c.read_eager().replace('\r','')

         if t:
            self.w.frame.tout.config(state='normal')
            self.w.frame.tout.insert(Tkinter.END, t)
            self.w.frame.tout.config(state='disabled')
            self.w.frame.tout.yview(Tkinter.END)   




This is just bits and pieces of a file I wrote a couple of years ago... 
I remember having trouble with the same thing.  Hope this helps.






More information about the Python-list mailing list