Skip to content

Commit

Permalink
Merge pull request #3 from Xnot/win-filechooser-buffer-passthrough
Browse files Browse the repository at this point in the history
Win filechooser buffer passthrough
  • Loading branch information
Xnot authored Dec 29, 2023
2 parents ff213c3 + 74e9965 commit b0ba7a0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions plyer/platforms/win/filechooser.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Win32FileChooser:
title = None
icon = None
show_hidden = False
buffer_size = 4096

def __init__(self, *args, **kwargs):
self._handle_selection = kwargs.pop(
Expand Down Expand Up @@ -77,10 +78,7 @@ def run(self):
args["Title"] = self.title if self.title else "Pick a file..."
args["CustomFilter"] = 'Other file types\x00*.*\x00'
args["FilterIndex"] = 1
file = ""
if "File" in args:
file = args["File"]
args["File"] = file + ("\x00" * 4096)
args["MaxFile"] = self.buffer_size

# e.g. open_file(filters=['*.txt', '*.py'])
filters = ""
Expand Down

0 comments on commit b0ba7a0

Please sign in to comment.