The format used to add widgets is the same as the one that we discussed in the previous task. To give you an idea about how it's done, here's some sample code that adds some common widgets:
Label(parent, text="Enter your Password:")Button(parent, text="Search")Checkbutton(parent, text="Remember Me", variable=v, value=True)Entry(parent, width=30)Radiobutton(parent, text="Male", variable=v, value=1)Radiobutton(parent, text="Female", variable=v, value=2)OptionMenu(parent, var, "Select Country", "USA", "UK", "India","Others")Scrollbar(parent, orient=VERTICAL, command= text.yview)
Can you spot the pattern that is common to each widget? Can you spot the differences?
As a reminder, the syntax for adding a widget ...