@@ -17,6 +17,8 @@ def __init__(self, sourceSDK, root):
17
17
self .create_widgets ()
18
18
self .load_files (self .current_folder )
19
19
20
+ self .previous_width = None
21
+
20
22
def create_widgets (self ):
21
23
"""
22
24
"""
@@ -105,6 +107,12 @@ def load_files(self, folder):
105
107
106
108
self .canvas .yview_moveto (0.0 )
107
109
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
+
108
116
def load_thumbnail (self , file_path ):
109
117
"""
110
118
"""
@@ -165,4 +173,13 @@ def open_file(self, pathFile):
165
173
"""
166
174
open_instance = Open (self .sdk )
167
175
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