Skip to content
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

Regarding the HelloWorld Julia Set example code for loop issue #7335

Closed
mmmovania opened this issue Feb 9, 2023 · 1 comment · Fixed by #7337
Closed

Regarding the HelloWorld Julia Set example code for loop issue #7335

mmmovania opened this issue Feb 9, 2023 · 1 comment · Fixed by #7337
Assignees
Labels
doc Documentation related issues & PRs

Comments

@mmmovania
Copy link

The HelloWorld Julia Set example code shown in the documentation and readme is running a for loop 1000000 times and calls the paint function on a GUI. This works but when you try to close your GUI window, it gives a RuntimeError

Exception has occurred: RuntimeError
Window close button clicked, exiting... (use `while gui.running` to exit gracefully)

A better way would have been to let it run until the GUI is open. So something like this should be better.

i = 1
while gui.running:
    paint(i * 0.03)
    gui.set_image(pixels)
    gui.show()
    i=i+1

This closes the GUI window and application gracefully without any error.

@mmmovania mmmovania added the doc Documentation related issues & PRs label Feb 9, 2023
@github-project-automation github-project-automation bot moved this to Untriaged in Taichi Lang Feb 9, 2023
@ailzhang ailzhang moved this from Untriaged to Todo in Taichi Lang Feb 10, 2023
@neozhaoliang
Copy link
Contributor

Thank you for pointing out this nit! This will be fixed by the above PR.

neozhaoliang added a commit that referenced this issue Feb 10, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in Taichi Lang Feb 10, 2023
quadpixels pushed a commit to quadpixels/taichi that referenced this issue May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Documentation related issues & PRs
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants