0 Replies - 1956 Views - Last Post: 28 August 2012 - 06:54 AM Rate Topic: -----

#1 shulgin  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 7
  • Joined: 12-August 12

tkinter scroll bar issues

Posted 28 August 2012 - 06:54 AM

Hey guys,

having some issues with user generated entry fileds in python.
I'm doing this with the following bit of script, the actual script is a lot longer but this is in essence what I'm trying to do


from Tkinter import *
root = Tk()
textoutput = []
textbox = Entry(root, width = 5) 
textinput = []

x = 0 
offset = 0
yco = 40
press = 0 

textbox.pack()
textbox.place(x = 10, y = yco + offset) 

def addtextbox():
   global textinput, x, yco, offset, press, textbox

 offset = offset + 30
 txtinput = textbox.get()
 textinput.append(txtinput)

 textbox = Entry(root, width = 5)
 textbox.place(x = 10, y = yco + offset)



add = Button(root, text = "Add box", width = 10, command = addtextbox)    

add.pack()
add.place(x = 225, y = 5)

root.mainloop()





The problem I'm having is that it gets to a certain point when there are too many text boxes to see and I need a scroll bar. I've tried using some sample code from effbot.org and some other places that I've googled but all they seem to do is scroll the background and not the text boxes themselves.

Any ideas ?

Cheers

Aaron

Is This A Good Question/Topic? 0
  • +

Page 1 of 1