77from tkinter import ttk
88from PIL import Image , ImageTk
99
10-
11-
1210class ToplevelWindow (customtkinter .CTkToplevel ):
1311 def __init__ (self , * args , ** kwargs ):
1412 super ().__init__ (* args , ** kwargs )
1513 self .geometry ("1000x500" )
1614 self .grid_columnconfigure ((0 , 1 ), weight = 1 )
1715 self .grid_rowconfigure (0 , weight = 1 )
1816
19- # self.fig, self.ax = plt.subplots()
20- # self.table = self.ax.table(cellText=self.values, loc='center', cellLoc='center')
21- # self.ax.axis("off")
22- # self.table.auto_set_font_size(False)
23- # self.table.set_fontsize(12)
24- # self.table.scale(1, 1.5)
25- # plt.savefig("output\Processtable .png")
17+ self .fig , self .ax = plt .subplots ()
18+ self .table = self .ax .table (cellText = self .values , loc = 'center' , cellLoc = 'center' )
19+ self .ax .axis ("off" )
20+ self .table .auto_set_font_size (False )
21+ self .table .set_fontsize (12 )
22+ self .table .scale (1 , 1.5 )
23+ plt .savefig ("table .png" )
2624
2725
2826 self .myimg = customtkinter .CTkImage (Image .open ("table.png" ), size = (400 , 400 ))
2927 self .imgLabel = customtkinter .CTkLabel (self , image = self .myimg , text = "" )
3028 self .imgLabel .grid (row = 0 , column = 0 , sticky = "nsew" )
3129
32- self ._myimg = customtkinter .CTkImage (Image .open ("output/Processtable.png" ), size = (400 , 400 ))
33- self ._imgLabel = customtkinter .CTkLabel (self , image = self ._myimg , text = "" )
34- self ._imgLabel .grid (row = 0 , column = 1 , sticky = "nsew" )
35-
30+
3631
3732# class PlotWindow(customtkinter.CTkFrame):
3833# def __init__(self, master):
@@ -105,13 +100,12 @@ def setAlgo(self, choice):
105100 return choice
106101
107102 def startExecution (self ):
108-
109103 if self .AlgoMenu .get () == "Preemptive Priority Scheduling" :
110104 print ("This is Preemptive Priority Scheduling" )
111105 elif self .AlgoMenu .get () == "Non-Preemtive Priotity Scheduling" :
112106
113107 self .toplev = ToplevelWindow (self )
114- # self.processList = self.NonPPS_Instance.Random_Input(int(self.Process_Input.get()), math.trunc(self.Burst_Time.get()))
108+ self .processList = self .NonPPS_Instance .Random_Input (int (self .Process_Input .get ()), math .trunc (self .Burst_Time .get ()))
115109 # self.Plot_Window.DrawTable(int(self.Process_Input.get()))
116110 # self.TopWin = ToplevelWindow(self)
117111 # self.myimg = customtkinter.CTkImage(light_image=Image.open("table.png"), size=(100,100))
@@ -125,10 +119,14 @@ def __init__(self):
125119 super ().__init__ ()
126120
127121 self .title ("CPU Scheduler Algorithm" )
128- self .geometry ("1000x500 " );
122+ self .geometry ("1000x300 " );
129123 self .grid_columnconfigure (0 , weight = 1 )
130124 self .grid_rowconfigure (0 , weight = 1 )
131125
126+ ## Welcome Label
127+ self .greet = customtkinter .CTkLabel (self , text = "CPU Algorithm Simulator" , fg_color = "transparent" )
128+ self .greet .grid (row = 0 , column = 0 , sticky = "nsew" )
129+
132130 ### OPTION MENU
133131 self .optionMenu = OptionWindow (self )
134132 self .optionMenu .grid (row = 1 , column = 0 , sticky = "ew" , columnspan = 2 , padx = 50 , pady = 10 )
0 commit comments