Skip to content

Commit 6a12aa5

Browse files
committed
add resize
1 parent 82f7c54 commit 6a12aa5

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

_vpk.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,12 @@ def extract_file(path):
164164
base_name = os.path.splitext(file_name)[0]
165165
related_files = []
166166
for ext in related_extensions:
167-
related_temp_path = extract_file(base_name + ext)
168-
if related_temp_path:
169-
related_files.append(related_temp_path)
167+
try:
168+
related_temp_path = extract_file(base_name + ext)
169+
if related_temp_path:
170+
related_files.append(related_temp_path)
171+
except OSError:
172+
print("mdl error")
170173

171174
# Ensure all required files are present
172175
if len(related_files) != len(related_extensions):

file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def display_files(self):
105105

106106
self.tree.bind("<Double-Button-1>", self.open_file)
107107

108-
self.fileList = FileListApp(self.sdk, self.root)
108+
self.fileList = FileListApp(self.sdk, self.root)
109109

110110
def open_file(self, event):
111111
"""

fileListApp.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)