package lablgtk3
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=d4821cdbecf3ae374f20317d63e43fe58030c3ba9657b51a2e83e652197e8eac
sha512=83f0be38a1e21737de93f88b0adac15cdcc50cf712d773720b9bc1e8d8ffdb2c660d35840f25d326a42a9d4e6537e6cef466099bf72494196b2cc79977e703e3
doc/lablgtk3/GtkThread/index.html
Module GtkThreadSource
The main loop to use with threads. GMain.main does not work! This changes GMain.main to call threaded_main rather than GtkMain.Main.default_main, so subsequent calls will work. The first call sets the GUI thread, and subsequent calls to main will be automatically routed through sync. With system threads, the ocaml giant lock is now released on polling, so that other ocaml threads can run without busy wait.
Setting busy_waiting to true forces the main loop to be non-blocking. This is required with VM threads. The default value is set to true at startup if the environment variable LABLGTK_BUSY_WAIT is set to something other than 0.
Setting busy_waiting to true forces the main loop to be non-blocking. This is required with VM threads. The default value is set to true at startup if the environment variable LABLGTK_BUSY_WAIT is set to something other than 0.
Start the main loop in a new GUI thread. Do not use recursively. Do not use with the Quartz backend, as the GUI must imperatively run in the main thread.
Start the main loop in a new GUI thread. Do not use recursively. Do not use with the Quartz backend, as the GUI must imperatively run in the main thread.
The real main function
The real main function
Forget the current GUI thread. The next call to main will register its caller as GUI thread.
Forget the current GUI thread. The next call to main will register its caller as GUI thread.
Add an asynchronous job (to do in the main thread)
Add a synchronous job (to do in the main thread)
Add a synchronous job (to do in the main thread)
Whether it is safe to call most GTK functions directly from the current thread
Whether it is safe to call most GTK functions directly from the current thread
Allow other threads to run, and process the message queue. The following ensures that messages will be processed even if another main loop is running: Glib.Timeout.add ~ms:100 ~callback:GtkThread.do_jobs
Allow other threads to run, and process the message queue. The following ensures that messages will be processed even if another main loop is running: Glib.Timeout.add ~ms:100 ~callback:GtkThread.do_jobs
Set the delay used in the main loop when busy_waiting is true. Higher value will make the application less CPU-consuming, but (relatively) less reactive. Default value is 0.013 .