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

[GUI] Add ti.GUI.EXIT event to close a window #1152

Merged
merged 20 commits into from
Jun 7, 2020

Conversation

archibate
Copy link
Collaborator

@archibate archibate commented Jun 5, 2020

Related issue = #1118

[Click here for the format server]

@xumingkuan Could you do me a favor by testing this sample code:

gui = ti.GUI("Hello")
while gui.running:
   gui.show()

print('GUI closed')

when you have time? Many thanks :)

@k-ye Would you mind to add this feature to cocoa following the win32&x11 as example itpr / iapr? No rush at all, any time before v0.6.8 is ok :)

@archibate archibate added rendering windows Microsoft Windows platform linux Linux platform labels Jun 5, 2020
Copy link
Member

@k-ye k-ye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind to add this feature to cocoa following the win32&x11 as example itpr / iapr?

Of course :) (Unless there's someone on a Mac that's interested in this task?)

taichi/gui/gui.h Show resolved Hide resolved
taichi/gui/x11.cpp Outdated Show resolved Hide resolved
@xumingkuan
Copy link
Contributor

I can't close the window :(

Hitting the "close" button has no effect.

@archibate
Copy link
Collaborator Author

I can't close the window :(

Hitting the "close" button has no effect.

Sorry! It should works now.

@xumingkuan
Copy link
Contributor

I can't close the window :(
Hitting the "close" button has no effect.

Sorry! It should works now.

Interesting... GUI closed is printed after I hit the button, but the GUI is not closed.

@archibate
Copy link
Collaborator Author

How about this? DestroyWindow?

@xumingkuan
Copy link
Contributor

Same behavior after the new commits...

GUI closed is printed and the window becomes "no response" after I hit the close button.

@xumingkuan
Copy link
Contributor

It works!!!

@archibate archibate requested a review from k-ye June 6, 2020 05:15
@archibate
Copy link
Collaborator Author

Great! I'll merge this for now once @yuanming-hu approves me, and please add a Mac version before Jun 7 we release v0.6.8 if someone feel interested :)

@archibate archibate added this to the v0.6.8 milestone Jun 6, 2020
docs/gui.rst Outdated Show resolved Hide resolved
taichi/gui/x11.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@xumingkuan xumingkuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM in general. Thanks!

docs/gui.rst Outdated Show resolved Hide resolved
Copy link
Member

@k-ye k-ye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

Co-authored-by: xumingkuan <xumingkuan0721@126.com>
@archibate archibate merged commit 4390448 into taichi-dev:master Jun 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linux Linux platform windows Microsoft Windows platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants