aboutsummaryrefslogtreecommitdiffstats
path: root/lvc/widgets/gtk/weakconnect.py
diff options
context:
space:
mode:
Diffstat (limited to 'lvc/widgets/gtk/weakconnect.py')
-rw-r--r--lvc/widgets/gtk/weakconnect.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lvc/widgets/gtk/weakconnect.py b/lvc/widgets/gtk/weakconnect.py
index 204a855..59db105 100644
--- a/lvc/widgets/gtk/weakconnect.py
+++ b/lvc/widgets/gtk/weakconnect.py
@@ -35,6 +35,7 @@ widgets and the wrapped GTK widget.
from lvc import signals
+
class WeakSignalHandler(object):
def __init__(self, method):
self.method = signals.WeakMethodReference(method)
@@ -51,6 +52,7 @@ class WeakSignalHandler(object):
else:
obj.disconnect(self.signal_handle)
+
def weak_connect(gobject, signal, method, *user_args):
handler = WeakSignalHandler(method)
return handler.connect(gobject, signal, *user_args)