Re: GUI freezes waiting for callback function to return
- From: Andrew Potter <agpotter gmail com>
- To: Mateusz Marzantowicz <mmarzantowicz osdf com pl>
- Cc: gtk-app <gtk-app-devel-list gnome org>
- Subject: Re: GUI freezes waiting for callback function to return
- Date: Thu, 13 Dec 2012 19:04:29 -0800
On Thu, Dec 13, 2012 at 5:57 AM, Mateusz Marzantowicz <
mmarzantowicz osdf com pl> wrote:
My application is supposed to do some extensive file operations which
may take a while depending on number of files.
If you don't want to offload your work to another thread, Glib has a whole
host of asynchronous file handling operations. I guess the python
documentation is here:
http://www.pygtk.org/docs/pygobject/gio-class-referenandce.html<http://www.pygtk.org/docs/pygobject/gio-class-reference.html>
I prefer to use threading of some kind and I'm little bit disappointed that
GTK+ doesn't offer that out of the box for menus, actions and callbacks.
AFAIK Windows and Android requires GUI functions to be called on the main
loop thread, so it is not unusual. Also, since GTK+ is supposed to work on
Windows it inherits that rule. You should be able to create a thread or
call whatever threading library you want from your callback, but if you
want to deliver results back to the GUI it has to be done back on the main
thread.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]