Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

callback interface suggestions #64

Open
marscher opened this issue Dec 22, 2021 · 1 comment
Open

callback interface suggestions #64

marscher opened this issue Dec 22, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@marscher
Copy link

Hi there,

thanks for this very useful utility! I just have a few things on my mind to make the callback interface more convenient.
First of all, it would be nice to support multiple callbacks (e.g. like IPyWidgets). So they will be stored in a list, and just invoked in the order of registration. I wonder why the parent interface has not been adopted here, since it is well designed.

Another nice to have feature would be to determine, how the value (path, file) have changed. This could also be analogous to ipywidgets, where you get passed a dictionary with "new", "old" keys to see the difference. Also the reference to the originating widget (e.g. the FileChooser triggering the event) is passed in this dictionary as the "owner" key.

This feature can be used to create backups prior saving a file. But I guess it is pretty general.

In the meantime I'd have to access the private ipywidgets for the Selection and obtain my values from there. But this is not very clean.

@crahan
Copy link
Owner

crahan commented Dec 22, 2021

Hi @marscher,

Thanks for the input and it's great to hear people are getting some value out of what started as nothing more than a small tool to scratch a personal itch 😄 . That said, that's also the biggest reason things like the Widget interface were never adopted. ipyfilechooser never started out as a real widget, but more as a collection of several other widget types that work together.

Just to make sure I'm understanding you correctly, you're refering to the CallbackDispatcher in the Widget class, correct? If so I think it makes a lot of sense to implement the Widget interface so we can leverage that functionality in ipyfilechooser.

Right now I have a few other priorities to focus on first, but I'll keep the issue open for follow-up. If you want to take a stab at a pull request or share a code sample of how you'd implement this, I'm more than happy to take a look at that as well.

@crahan crahan self-assigned this Dec 22, 2021
@crahan crahan added the enhancement New feature or request label Dec 22, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants