GUI freezes waiting for callback function to return



Hello,

I'm writing very simple application in Python using pygobject. I'm using
Gtk.Application, Gtk.ApplicationWindow and XML menu definition which is
parsed by Gtk.Builder(). I'm also using Gio.SimpleAction to call method
when user clicks on menu item.

What I've observed is that GUI (menu to be specific) freezes till my
callback function finishes. It's completely unacceptable for GUI
application but I don't know how to make/code it right.

Here is a piece of code that I use for menu actions:

my_action = Gio.SimpleAction.new('my-action', None)
my_action.connect('activate', self.my_callback_function)
self.add_action(my_action)

How can I rewrite this to work in non-blocking way?


Mateusz Marzantowicz



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]