py5coding / py5generator

Meta-programming project that creates the py5 library code.
https://py5coding.org/
GNU General Public License v3.0
52 stars 13 forks source link

Processing's selectInput() or selectFolder(), etc #98

Closed hx2A closed 2 years ago

hx2A commented 2 years ago

Can I add Processing's selectInput() or selectFolder(), etc. to py5's API? If not, what can py5 offer users who are looking for this functionality?

From this discussion thread

hx2A commented 2 years ago

I have a working prototype for py5.select_folder() that enables py5 to use Processing's selectFolder() functionality. It works, but there are two problems:

I'm hoping to do a release next week, and if I do, this probably won't be complete in time. I'll be sure to get it in the following release though.

hx2A commented 2 years ago

I have selectFolder() basically working and will get selectInput() and selectOutput() working next. I will duplicate what I did for selectFolder() for the other two.

The select dialog box doesn't work when run through Jupyter Notebook on OSX. This looks like a limitation we will have to live with. For folks using Jupyter, there are at least ipython widgets one can use instead. The select dialog box works great with the regular Python interpreter and Thonny.

This is probably an edge case, but right now the callback mechanism will only allow one select call at a time

There was an easy fix for this.

hx2A commented 2 years ago

This feature now works and has been tested on all platforms. Two things to note:

I'll make sure the documentation mentions all of these things.

The last thing I need to deal with is error handling. Right now exceptions in the callback result in a python stack trace and a Java stack trace. I want to avoid Java stack traces as much as possible.

hx2A commented 2 years ago

I now have the error handling the way I like it & the documentation changes are done.

@villares , if you think all of the above looks good to you, I'll merge this.

I have a few minor bugs to take care of and then I'll do a release.

villares commented 2 years ago

Looks great!

hx2A commented 2 years ago

This is now complete!