Page 315 -
P. 315

depot buttons


                          Pool Puzzle Solution


                          This is the section of the program that
                             creates the depot radio buttons.
                              You were asked to see if you could
                               complete it using the fragments of
                               code from the pool. Not all of the
                               pieces were needed.




           Label(app, text = "Depot:").pack()
           depot = StringVar()
           depot.set(None)
           Radiobutton(app, variable = depot, text = "Cambridge, MA", value = "Cambridge, MA").pack()
           Radiobutton(app, variable = depot, text = "Cambridge, UK", value = "Cambridge, UK").pack()
           Radiobutton(app, variable = depot, text = "Seattle, WA", value = "Seattle, WA").pack()



           Note: each thing from
           the pool can be used
           only once!







                           text
                                                                 "Cambridge"














                                                What piece of code would you use to make sure all of the radio
                                                buttons are cleared after the record is saved?
                 Because none of the radio       depot.set(None)
                 buttons have this value, none
                 of them will be selected.




           280    Chapter 8
   310   311   312   313   314   315   316   317   318   319   320