-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
run_sketch utility won't leave the window open if the sketch has setup() but no draw() #89
Comments
Seems like an odd scenario -- like, why bother with |
A bit of context: pyp5js wasn't working "in static mode" so I got into the
habit of making students work static sketches in setup()
Now, pedagogically, I find it useful to make students work in setup(),
makes the transition to setup/draw easier.
…On Thu, 23 Jun 2022, 06:38 tabreturn, ***@***.***> wrote:
Seems like an odd scenario -- like, why bother with setup() at all? Then
again, Processing.py will resort to static mode behavior -- so your dummy
draw proposal replicates that 👍
—
Reply to this email directly, view it on GitHub
<#89 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA4GADATLVSHX2NN5LV7CWTVQQV73ANCNFSM5ZNX75ZQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Right, it is an odd scenario, but it should still work in that situation. I don't think it will be a hard fix.
What if they don't know about functions yet? |
Yep, that's a challenge. Some noise they are putting up with! I noticed I use it in my own static sketches too. It lets me put the helper functions down the listing. |
Maybe consider using py5bot to help with that! Here's a notebook I used to do just that in a intro presentation two weeks ago: |
When I put this in Thonny and run it: def setup():
size(400, 400, P2D)
rect(10, 10, 20, 20) the window stays open, as it should. This bug only affects Sketches that use the default renderer. Also, this bug is related to #82. A proper fix for #82 will fix this bug as well. Any fix for this issue that does not also fix #82 is a hack. |
I fixed two seemingly unrelated bugs by removing one line of code. :) |
When I put this in Thonny and run it:
The window appears for a split second and then exits. If I add this:
Then the window appears. Need the same dummy draw method trick I use for static sketches.
The text was updated successfully, but these errors were encountered: