-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug, when user canceled filechooser, on_selection
does not dispatched
#666
Conversation
But, you didn't select anything, why should it be called? |
Because on others platform (win/linux) its called and if the user clicked the close button there is no way to find out it |
Does setting allownone and/or force_dispatch to True on you ListProperty not do the same? And without the issue created of defaulting to a True/Truthy value |
No, |
Doesn't seem to be the case on Linux? (i just tested and if i close the selection window, there is no change) |
Yes, on different platforms different return... |
that would be |
@tshirtman I can change in commit |
does not work |
Could adjust your commit so it passes None to _handle_selection - that shouldn't break how it currently operates. |
selection = None
if panel.runModal():
if self.mode == "save" or not self.multiple:
selection = [panel.filename().UTF8String()]
else:
filename = panel.filenames()
selection = [
filename.objectAtIndex_(x).UTF8String()
for x in range(filename.count())]
self._handle_selection(selection)
return selection # in app
selection = ListProperty([], allownone=True) so? |
Seems harmless to me, does that selection trigger / not trigger or error without the allownone. and _handle_selection is a dummy method so in app you can redefine that if need be. |
Thanks, done |
Just tried to read the relevant docs here, mind testing |
hmm, yes, I see |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
please fix the style issue though, (line > 80 breaks pep8)
Ah, yes, I see, fixed it) |
When clicking the close button, on OS X on_selection was not called
Demo.mp4