February 2019
Intermediate to advanced
450 pages
11h 59m
English
Before we can correctly handle background processing with Go-GTK (or any GTK+ implementations), we must correctly initialize the thread handling portions of the underlying libraries (glib and gdk). These lines should be entered at the start of an application's main() function:
glib.ThreadInit(nil)gdk.ThreadsInit()gdk.ThreadsEnter()gtk.Init(nil)
Once the thread handling has been set up, we can write background code that will communicate with the user interface. This code must execute on the same thread that the application was created with. To ensure this, we use the helper functions, gdk.ThreadsEnter() and gdk.ThreadsLeave(), around the code we wish to execute. For our application to add new messages to the end of our email ...
Read now
Unlock full access