Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
tk help needed

Posted by int_80 (int_80), 5 August 2006
Quote:
from Tkinter import*

class Application(Frame):
   def __init__(self,master):
       Frame.__init__(self,master)
       self.grid()
       
       Button(self,text = "ADD", command = self.update ).grid(row =1, column=1, sticky =NW)
       Button(self,text = "MCS 1-9").grid(row =1,column=2,sticky =NW)
       Button(self,text = "CSI 1-4").grid(row =1,column=3, sticky =NW)
       Button(self,text = "AMR").grid(row =1,column=4, sticky =NW)

   def update(self):

       Label(self,text="BAND").grid(row=3, column=1)
       Label(self,text="PROFILE").grid(row=3, column=2)
       Label(self,text="SPEED").grid(row=3, column=3)
       Label(self,text="TEST").grid(row=3, column=4)
       Label(self,text='RANGE').grid(row=3, column=5)

       var = StringVar()
       var.set("")
       option = OptionMenu(self, var,"900","1800","1900").grid( column=1, sticky = W)

       var = StringVar()
       var.set("")
       option = OptionMenu(self, var, "static","TU","TU high","TU low","RA","HT").grid(column=2,sticky = W)

       self.Tx_level = Entry(self)
       self.Tx_level.grid( column=3, columnspan=1)

       var = StringVar()
       var.set("")
       option = OptionMenu(self, var, "CCI","ACI","Senstivity").grid( column=4,sticky = W)


       self.Tx_level = Entry(self)
       self.Tx_level.grid(column=5,sticky = W)

       Button(self,text = "remove").grid(column=6)




class Application_2(LabelFrame):
   def __init__(self,master):
       LabelFrame.__init__(self,master)
       self.configure( text = 'DEFAULT', padx=20, pady=20 )
       self.grid()


       Label(self,text="BAND").grid(row=3, column=1)
       Label(self,text="PROFILE").grid(row=3, column=2)
       Label(self,text="SPEED").grid(row=3, column=3)
       Label(self,text="TEST").grid(row=3, column=4)
       Label(self,text='RANGE').grid(row=3, column=5)

       var = StringVar()
       var.set("") # initial value
       option = OptionMenu(self, var,"900","1800","1900").grid(row=4, column=1, sticky = W)

       var = StringVar()
       var.set("") # initial value
       option = OptionMenu(self, var, "static","TU","TU high","TU low","RA","HT").grid(row=4, column=2,sticky = W)

       self.Tx_level = Entry(self)
       self.Tx_level.grid(row=4, column=3, columnspan=1)

       var = StringVar()
       var.set("") # initial value
       option = OptionMenu(self, var, "CCI","ACI","Senstivity").grid(row=4, column=4,sticky = W)


       self.Tx_level = Entry(self)
       self.Tx_level.grid(row=4, column=5,sticky = W)


root= Tk()

root.title("Test")
root.geometry("600x300")
root.configure()

app =Application(root)
app_2=Application_2(root)

root.mainloop()


I need to understand what this does, I need to know how to delete a row of widgets. If you can help or this makes any sense I'd appreciate it to the point of unbelief.....

Posted by admin (Graham Ellis), 5 August 2006
There's two ways we can help.

Firstly, if you can post a shorter example of the part you don't understand - we ask you to do this in less that 30 lines in the FAQ - we've got a realistic chance of explaining enough of the code and helping you understand what's going on to so that you can work to your final solution.

Second option - if you don't yet feel confident in reading and maintaining a piece of Python code to the extent of isolating an issue, I can offer you a Python course to get you to that point.




This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2014: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho