|
4 | 4 | window = Tk() |
5 | 5 | window.title("Erin Hunter Book Chooser") |
6 | 6 |
|
7 | | -label = Label( window, text = "Welcome to the Erin Hunter Book Chooser.\nPlease choose your favorite animal and the app will select your most likely favorite book written by Erin Hunter.\n You can visit the website link displayed to learn more.\n\nClick the X button to continue!") |
| 7 | +label = Label( window, text = "Welcome to the Erin Hunter Book Chooser.\nPlease select your favorite animal below and the app will select your favorite Erin Hunter authored book.\n You can visit the website link displayed to learn more afterwards.\n") |
8 | 8 |
|
9 | 9 | label.pack( padx = 300, pady = 100 ) |
10 | 10 |
|
11 | | -import mainchoice |
| 11 | + |
| 12 | +frame = Frame(window) |
| 13 | + |
| 14 | +book = StringVar() |
| 15 | + |
| 16 | + |
| 17 | +radio_1 = Radiobutton( frame, text='Cats', \ |
| 18 | + variable = book, value = ' Warriors by Erin Hunter.\nVisit warriorscats.com for more information.') |
| 19 | +radio_2 = Radiobutton( frame, text='Bears', \ |
| 20 | + variable = book, value = ' Seekers by Erin Hunter.\nVisit seekrsbears.com for more information.') |
| 21 | +radio_3 = Radiobutton(frame, text='Dogs', \ |
| 22 | + variable = book, value = ' Survivors by Erin Huter.\nVisit survivorsdogs.com for more information.') |
| 23 | + |
| 24 | +radio_1.select() |
| 25 | + |
| 26 | +def dialog(): |
| 27 | + box.showinfo('Erin Hunter Book Selection', \ |
| 28 | + 'Your Erin Hunter Book selection is:' + book.get() ) |
| 29 | + |
| 30 | +btn = Button( frame, text = 'Choose', command = dialog) |
| 31 | + |
| 32 | +btn.pack(side = RIGHT, padx = 5) |
| 33 | +radio_1.pack(side = LEFT) |
| 34 | +radio_2.pack(side = LEFT) |
| 35 | +radio_3.pack(side = LEFT) |
| 36 | +frame.pack( padx = 30, pady = 30 ) |
| 37 | + |
| 38 | +window.mainloop() |
| 39 | + |
12 | 40 |
|
13 | 41 | window.mainloop() |
14 | 42 |
|
0 commit comments