Closed RicardoEPRodrigues closed 5 years ago
That's awesome. Thank you very much.
when I have the time I'll complete the rest, file saving at least. :smile:
I wrote simple file save functionality by modifying your file open code, here. Please do not hesitate to do corrections, And don't worry about the async, threading is hard and not worth the effort 😄
Thanks again for your amazing contribution.
Cheers!
It's very simple and nice!
It is weird, but the last loop is what makes this all work well:
while (gtk_events_pending ())
gtk_main_iteration ();
Yeah, gtk environment is weird.
I tried to get root GtkWindow for parent parameter. but didn't figured it out. Probably unity creates GtkApplication and GtkWindow somewhere internally, but doesn't expose them for use.
Tried to do this but no luck. It returns NULL for GApplication
GtkApplication* app = GTK_APPLICATION (g_application_get_default ();
GtkWindow* window = gtk_application_get_active_window (app);
Anyway, i have no idea how gtk works :)
Unity uses GTK on the Editor side. The Standalone doesn't use GTK internally, so we have to initialize it and deal with the loop.
Oh, i understand.
Copied Mac OS File Browser c# and added similar behavior.
Used C and GTK to create a Dialog to select files.
WHAT DOES NOT WORK: file saving and Async.