-
-
Notifications
You must be signed in to change notification settings - Fork 334
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
[GTK] Use of MessageBox.Show on different threads is inconsistent #2002
Comments
I don't think you can reliably do anything UI-related except on the main thread. That's the reason for AsyncInvoke and similar. You might get away with it sometimes, mostly by luck, but that's the exception rather than the rule. |
The thing is, I can do it reliably if I use either WPF or WinForms. |
Different toolkits and different platforms have different tolerances. It's been apparent to me that GTK is the most sensitive, followed by macOS. WinForms is less sensitive than WPF, but all of them are affected by this basic assumption, that all UI activity happens on the main thread. If you throw an Invoke or AsyncInvoke around your UI command, it should improve matters considerably. |
I concur with @philstopford. Yes, WPF and WinForms allow using a MessageBox from separate threads but Gtk and macOS do not. Both WPF and WinForms can also have UI initialized on any particular thread. They are the only platforms that allow this. macOS will also crash if you try to show a message box from a These are limitations of the respective UI frameworks. With Eto, always |
Hm, would it be possible to somehow put a warning, if you're trying to use something in a way that won't work on all platforms? |
Expected Behavior
It should act like it does on WPF and Winforms.
Actual Behavior
It doesn't act like it does on Windows, and instead crashes.
This is how it looks like on Windows:
On Gtk (running under Linux), it just crashes. Sometimes it writes something to stdout, sometimes it doesn't. No consistency in what it writes.
Steps to Reproduce the Problem
Code that Demonstrates the Problem
Specifications
Haven't tested the behaviour on OSX yet.
The text was updated successfully, but these errors were encountered: