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

Managing window from GO #5

Open
krzysztofantczak opened this issue Nov 9, 2020 · 2 comments
Open

Managing window from GO #5

krzysztofantczak opened this issue Nov 9, 2020 · 2 comments

Comments

@krzysztofantczak
Copy link

Hey,

I have played with JS functions exposed in your example to affect the window and it worked fine, but when I tried from the side of GO, seems like it's not working. Added this code right after this line https://github.com/Gurkengewuerz/cefgo/blob/master/examples/mainthread/main.go#L72:

		time.AfterFunc(time.Second*5, func() {
			client.WindowHide()
		})

To hide the window after 5 seconds. Nothing happens, no error, nothing. Any ideas?

@Gurkengewuerz
Copy link
Owner

The biggest issue is, that you have to be in the right thread. timeAfter.Func is in a completely new thread and dont have access to the Main thread where the WindowHide function has to be

@krzysztofantczak
Copy link
Author

krzysztofantczak commented Nov 9, 2020

By thread You mean process? Also, how can I get there? I was trying to poke around the code for a bit but couldn't figure out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants