11
2- # This program can be used, but some features aren't completely ready yet. I'll update this soon to fix all bugs.
32import matplotlib .pyplot as plt
43import tkinter as tk
54
@@ -22,6 +21,9 @@ def isfloat(self):
2221
2322
2423window = tk .Tk ()
24+ for _ in range (8 ):
25+ window .columnconfigure (_ , weight = 1 )
26+ window .rowconfigure (_ , weight = 1 )
2527
2628pcc_logo = tk .PhotoImage (file = "PCC_Logo.png" )
2729pcc_logo_lbl = tk .Label (window , image = pcc_logo )
@@ -32,6 +34,20 @@ def isfloat(self):
3234explode = []
3335
3436
37+ def instructions ():
38+ instructions_file = open ("instructions.txt" )
39+ instructions = tk .Tk ()
40+ def exit_instructions ():
41+ instructions .destroy ()
42+ instruction_lbl = tk .Label (
43+ master = instructions ,
44+ text = instructions_file .read ()
45+ )
46+ instruction_lbl .grid (row = 1 , column = 1 , sticky = "W" )
47+ back_to_pcc_btn = tk .Button (master = instructions , text = "Back to Pie Chart Creator" , command = exit_instructions )
48+ back_to_pcc_btn .grid (row = 2 , column = 1 , pady = 5 )
49+
50+
3551def append ():
3652 def exit_not_appended ():
3753 not_appended .destroy ()
@@ -55,10 +71,11 @@ def exit_not_appended():
5571 not_appended = tk .Tk ()
5672 not_appended_label = tk .Label (
5773 master = not_appended ,
58- text = f"Values not added to register\n because { percentage_entry .get ()} is not a\n valid decimal number.\n Press any key to exit this\n warning menu."
74+ text = f"Values not added to register\n because \" { percentage_entry .get ()} \" is not a\n valid decimal number.\n Press any key to exit this\n warning menu."
5975 )
60- not_appended_label .bind ('<KeyPress>' , exit_not_appended )
6176 not_appended_label .pack ()
77+ back_btn = tk .Button (master = not_appended , text = "Back to Pie Chart Creator" , command = exit_not_appended )
78+ back_btn .pack (fill = tk .X )
6279
6380
6481def show_register ():
@@ -179,19 +196,19 @@ def back_to_pcc():
179196item_entry = tk .Entry ()
180197
181198item_entry_lbl .grid (row = 1 , column = 1 , sticky = "W" )
182- item_entry .grid (row = 1 , column = 2 , columnspan = 2 , sticky = "WE" )
199+ item_entry .grid (row = 1 , column = 2 , sticky = "WE" )
183200
184201percentage_entry_lbl = tk .Label (text = "Percentage:" )
185202percentage_entry = tk .Entry ()
186203
187204percentage_entry_lbl .grid (row = 2 , column = 1 , sticky = "W" )
188- percentage_entry .grid (row = 2 , column = 2 , columnspan = 2 , sticky = "WE" )
205+ percentage_entry .grid (row = 2 , column = 2 , sticky = "WE" )
189206
190207explode_entry_lbl = tk .Label (text = "Enable emphasis(Y/N):" )
191208explode_entry = tk .Entry ()
192209
193210explode_entry_lbl .grid (row = 3 , column = 1 , sticky = "W" )
194- explode_entry .grid (row = 3 , column = 2 , columnspan = 2 , sticky = "WE" )
211+ explode_entry .grid (row = 3 , column = 2 , sticky = "WE" )
195212
196213append_btn = tk .Button (
197214 text = "Add values to register" ,
@@ -213,11 +230,16 @@ def back_to_pcc():
213230 text = "View register" ,
214231 command = show_register
215232)
233+ instructions_btn = tk .Button (
234+ text = "Read Instructions" ,
235+ command = instructions
236+ )
216237
217238append_btn .grid (row = 4 , column = 1 , sticky = "WE" , padx = 1 , pady = 1 )
218- show_register_btn .grid (row = 4 , column = 2 , columnspan = 2 , sticky = "WE" , padx = 1 , pady = 1 )
239+ show_register_btn .grid (row = 4 , column = 2 , sticky = "WE" , padx = 1 , pady = 1 )
219240clear_btn .grid (row = 5 , column = 1 , sticky = "WE" , padx = 1 , pady = 1 )
220- exit_btn .grid (row = 5 , column = 2 , columnspan = 2 , sticky = "WE" , padx = 1 , pady = 1 )
221- make_chart_btn .grid (row = 6 , column = 1 , columnspan = 3 , sticky = "WE" , padx = 1 , pady = 1 )
241+ exit_btn .grid (row = 5 , column = 2 , sticky = "WE" , padx = 1 , pady = 1 )
242+ make_chart_btn .grid (row = 7 , column = 1 , columnspan = 2 , sticky = "WE" , padx = 1 , pady = 1 )
243+ instructions_btn .grid (row = 6 , column = 1 , columnspan = 2 , sticky = "WE" , padx = 1 , pady = 1 )
222244
223245window .mainloop ()
0 commit comments