Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Commit 2cfeabc

Browse files
Added main program files.
1 parent 2f87696 commit 2cfeabc

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from tkinter import *
2+
import tkinter.messagebox as box
3+
4+
window = Tk()
5+
window.title("Erin Hunter Book Chooser")
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!")
8+
9+
label.pack( padx = 300, pady = 100 )
10+
11+
import mainchoice
12+
13+
window.mainloop()
14+

mainchoice.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
from tkinter import*
2+
import tkinter.messagebox as box
3+
4+
window = Tk()
5+
window.title('Chose your favorite Erin Hunter book')
6+
7+
frame = Frame(window)
8+
9+
book = StringVar()
10+
11+
12+
radio_1 = Radiobutton( frame, text='Cats', \
13+
variable = book, value = ' Warriors.\nVisit warriorscats.com for more information.')
14+
radio_2 = Radiobutton( frame, text='Bears', \
15+
variable = book, value = ' Seekers.\nVisit seekrsbears.com for more information.')
16+
radio_3 = Radiobutton(frame, text='Dogs', \
17+
variable = book, value = ' Survivors.\nVisit survivorsdogs.com for more information.')
18+
19+
radio_1.select()
20+
21+
def dialog():
22+
box.showinfo('Erin Hunter Book Selection', \
23+
'Your Erin Hunter Book selection is:' + book.get() )
24+
25+
btn = Button( frame, text = 'Choose', command = dialog)
26+
27+
btn.pack(side = RIGHT, padx = 5)
28+
radio_1.pack(side = LEFT)
29+
radio_2.pack(side = LEFT)
30+
radio_3.pack(side = LEFT)
31+
frame.pack( padx = 30, pady = 30 )
32+
33+
window.mainloop()

0 commit comments

Comments
 (0)