mirror of
https://github.com/gryf/pygtktalog.git
synced 2025-12-18 12:00:21 +01:00
* Upgraded pygtkmvc to version 1.0.1.
This commit is contained in:
@@ -37,11 +37,15 @@ class ModelMT (Model):
|
||||
changed by threads different than gtk main thread. Notification is
|
||||
performed by exploiting the gtk idle loop only if needed,
|
||||
otherwise the standard notification system (direct method call) is
|
||||
used."""
|
||||
used. In this model, the observer is expected to run in the gtk
|
||||
main loop thread."""
|
||||
|
||||
__metaclass__ = support.metaclasses.ObservablePropertyMetaMT
|
||||
|
||||
def __init__(self):
|
||||
Model.__init__(self)
|
||||
self.__observer_threads = {}
|
||||
self._prop_lock = _threading.Lock()
|
||||
return
|
||||
|
||||
def register_observer(self, observer):
|
||||
@@ -65,7 +69,7 @@ class ModelMT (Model):
|
||||
if _threading.currentThread() == self.__observer_threads[observer]:
|
||||
# standard call
|
||||
return Model.__notify_observer__(self, observer, method,
|
||||
args, kwargs)
|
||||
*args, **kwargs)
|
||||
|
||||
# multi-threading call
|
||||
gobject.idle_add(self.__idle_callback, observer, method, args, kwargs)
|
||||
@@ -84,7 +88,7 @@ import gtk
|
||||
class TreeStoreModelMT (ModelMT, gtk.TreeStore):
|
||||
"""Use this class as base class for your model derived by
|
||||
gtk.TreeStore"""
|
||||
__metaclass__ = support.metaclasses.ObservablePropertyGObjectMeta
|
||||
__metaclass__ = support.metaclasses.ObservablePropertyGObjectMetaMT
|
||||
|
||||
def __init__(self, column_type, *args):
|
||||
ModelMT.__init__(self)
|
||||
@@ -97,7 +101,7 @@ class TreeStoreModelMT (ModelMT, gtk.TreeStore):
|
||||
class ListStoreModelMT (ModelMT, gtk.ListStore):
|
||||
"""Use this class as base class for your model derived by
|
||||
gtk.ListStore"""
|
||||
__metaclass__ = support.metaclasses.ObservablePropertyGObjectMeta
|
||||
__metaclass__ = support.metaclasses.ObservablePropertyGObjectMetaMT
|
||||
|
||||
def __init__(self, column_type, *args):
|
||||
ModelMT.__init__(self)
|
||||
@@ -110,7 +114,7 @@ class ListStoreModelMT (ModelMT, gtk.ListStore):
|
||||
class TextBufferModelMT (ModelMT, gtk.TextBuffer):
|
||||
"""Use this class as base class for your model derived by
|
||||
gtk.TextBuffer"""
|
||||
__metaclass__ = support.metaclasses.ObservablePropertyGObjectMeta
|
||||
__metaclass__ = support.metaclasses.ObservablePropertyGObjectMetaMT
|
||||
|
||||
def __init__(self, table=None):
|
||||
ModelMT.__init__(self)
|
||||
|
||||
Reference in New Issue
Block a user