Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > problem adding a scrollbar to a text widget

Reply
Thread Tools

problem adding a scrollbar to a text widget

 
 
Chris Hare
Guest
Posts: n/a
 
      08-04-2010
Here is my chunk of code. I can't figure out what I am doing wrong to put my scrollbar on the right hand side of the text box.

from Tkinter import *

def showLogFile():
top = Toplevel()
f = Frame(top, bd=0, bg="Gray")
top.title = "netcomm log file"
f.grid()
sc = Scrollbar(top)
sc.grid()
t = Text(f, yscrollcommand = sc.set)
sc.config(command=t.yview)
t.insert(END,"This is a line of text")
t.config(height=20,width=80,bg="Gray")
button = Button(f, text="Dismiss", command=top.destroy, highlightbackground="Red")
t.grid()
button.grid()


showLogFile()
mainloop()

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tkinter.event.widget: handler gets name instead of widget. Frederic Rentsch Python 0 07-08-2012 09:19 PM
Ruby/Tk: how to get Scrollbar to stay scrolled on non-scroll widget? Chris Ruby 1 02-27-2009 06:13 AM
user interface widget: ordered selection list: do any UI library has this widget? zhangweiwu@realss.com Javascript 0 10-10-2006 01:02 AM
ScrollBar? Does it exist just WEB ScrollBar Control? Alex ASP .Net Web Controls 1 04-04-2004 12:44 AM



Advertisments