@@ -15,7 +15,12 @@ def __init__(self,root):
1515 self .root .geometry ("300x150" )
1616 self .root .resizable (False , False )
1717 self .root .title ("Algorithm Visualizer" )
18- self .root .iconbitmap ("Images/hnet.com-image.ico" )
18+ try :
19+ self .root .iconbitmap ("Images/hnet.com-image.ico" )
20+ except :
21+ img = PhotoImage ("Images/hnet.com-image.ico" )
22+ self .root .tk .call ('wm' , 'iconphoto' , self .root ._w , img )
23+
1924
2025 self .AlgoTypeLabel = Label (self .root , text = 'Select Algorithm Type:-' , font = ("Courier" , 10 ))
2126 self .AlgoTypeLabel .pack (pady = 2 )
@@ -94,8 +99,12 @@ def SecondWindow(self):
9499 self .root .geometry ("725x300" )
95100 self .root .resizable (False , False )
96101 self .root .title (self .AlgoTypeVar .get ())
97- self .root .iconbitmap ("Images/hnet.com-image.ico" )
98-
102+ try :
103+ self .root .iconbitmap ("Images/hnet.com-image.ico" )
104+ except :
105+ img = PhotoImage ("Images/hnet.com-image.ico" )
106+ self .root .tk .call ('wm' , 'iconphoto' , self .root ._w , img )
107+
99108 self .AlgoNameLabel = Label (self .root , text = ' Select Algorithm Name:-' , pady = 5 , font = ("Courier" , 10 ))
100109 self .AlgoNameLabel .grid (row = 0 , column = 1 )
101110
@@ -143,7 +152,12 @@ def SecondWindow(self):
143152 self .root .geometry ("750x300" )
144153 self .root .resizable (False , False )
145154 self .root .title (self .AlgoTypeVar .get ())
146- self .root .iconbitmap ("Images/hnet.com-image.ico" )
155+ try :
156+ self .root .iconbitmap ("Images/hnet.com-image.ico" )
157+ except :
158+ img = PhotoImage ("Images/hnet.com-image.ico" )
159+ self .root .tk .call ('wm' , 'iconphoto' , self .root ._w , img )
160+
147161
148162 self .AlgoNameLabel = Label (self .root , text = ' Select Algorithm Name:-' , pady = 5 , font = ("Courier" , 10 ))
149163 self .AlgoNameLabel .grid (row = 0 , column = 1 )
@@ -192,8 +206,13 @@ def SecondWindow(self):
192206 self .root .geometry ("750x300" )
193207 self .root .resizable (False , False )
194208 self .root .title (self .AlgoTypeVar .get ())
195- self .root .iconbitmap ("Images/hnet.com-image.ico" )
209+ try :
210+ self .root .iconbitmap ("Images/hnet.com-image.ico" )
211+ except :
212+ img = PhotoImage ("Images/hnet.com-image.ico" )
213+ self .root .tk .call ('wm' , 'iconphoto' , self .root ._w , img )
196214
215+
197216 self .AlgoNameLabel = Label (self .root , text = ' Select Algorithm Name:-' , pady = 5 , font = ("Courier" , 10 ))
198217 self .AlgoNameLabel .grid (row = 0 , column = 1 )
199218
0 commit comments