@@ -17,6 +17,8 @@ def __init__(self, sourceSDK, root):
1717 self .create_widgets ()
1818 self .load_files (self .current_folder )
1919
20+ self .previous_width = None
21+
2022 def create_widgets (self ):
2123 """
2224 """
@@ -105,6 +107,12 @@ def load_files(self, folder):
105107
106108 self .canvas .yview_moveto (0.0 )
107109
110+ # Bind the <Configure> event to handle resizing
111+ self .root .bind ("<Configure>" , self .resize )
112+
113+ # Initialize the previous width
114+ self .previous_width = self .root .winfo_width ()
115+
108116 def load_thumbnail (self , file_path ):
109117 """
110118 """
@@ -165,4 +173,13 @@ def open_file(self, pathFile):
165173 """
166174 open_instance = Open (self .sdk )
167175 open_instance .open_file (localpath = pathFile )
168-
176+
177+ def resize (self , event ):
178+ """
179+ Handle the window resize event.
180+ """
181+ new_width = self .root .winfo_width ()
182+ if new_width != self .previous_width :
183+ self .previous_width = new_width
184+ # Add the code you want to execute when the width changes
185+ self .load_files (self .current_folder )
0 commit comments