I’ve been working on an app that uses the FileBrowseButton. All works as expected except in one circumstance. When the user changes the file name in the FBB, the callback function asks her if she wants to save some unsaved work before allowing the change. If the change is disallowed by the user, then the callback sets the filename back to its previous value, disabling another callback due to this change.
If the user changes the filename by direct editing of the FBB TextCtrl, then the callback is called once, as expected. However, if the Browse button is used to change the filename, the callback is called twice, which means the “disallow” dialogue is presented to the user twice. Tracing the operation of the code, it seems (to me) that the cause is inside the binary code underneath the widget rather than the Python code.
A modified version of the FileBrowseButton demo code that demonstrates the problem is attached (just the TestPanel class).
Steve.
FBBcallbackproblem.py (961 Bytes)