mrv.maya.ui.util

Epydoc: mrv.maya.ui.util

Utilities and classes useful for user interfaces

Functions

Classes

Epydoc: mrv.maya.ui.util

Epydoc: mrv.maya.ui.util

class mrv.maya.ui.util.Call(func, *args, **kwargs)

Bases: object

Call object encapsulating any code, thus providing a simple facade for it :note: derive from it if a more complex call is required

args
func
kwargs

Epydoc: mrv.maya.ui.util

Epydoc: mrv.maya.ui.util

Epydoc: mrv.maya.ui.util

Epydoc: mrv.maya.ui.util

Epydoc: mrv.maya.ui.util

class mrv.maya.ui.util.Event(**kwargs)

Bases: object

Descriptor allowing to easily setup callbacks for classes derived from EventSender

duplicate()
remove(eventfunc)
remove the given function from this event :note: will not raise if eventfunc does not exist
send(*args, **kwargs)

Send our event using the given args

Note:if an event listener is weak referenced and goes out of scope
Note:will catch all event exceptions trown by the methods called
Returns:False if at least one event call threw an exception, true otherwise

Epydoc: mrv.maya.ui.util

class mrv.maya.ui.util.EventSender

Bases: object

Base class for all classes that want to provide a common callback interface to supply event information to clients.

Usage: Derive from this class and define your callbacks like:

>>> event = Event()
>>> # Call it using
>>> self.event.send([*args][,**kwargs]])
>>> # Users register using
>>> yourinstance.event = callable
>>> # and deregister using
>>> yourinstance.event.remove(callable)
Note:if use_weakref is True, we will weakref the eventfunction, and deal properly with instance methods which would go out of scope immediatly otherwise
Note:using weak-references to ensure one does not keep objects alive, see Event.use_weakref
clearAllEvents()

Remove all event receivers for all events registered in this instance.

Note:This usually doesn’t need to be called directly, but might be useful in conjunction with other system that do not release your strongly bound instance
classmethod listEventNames()
Returns:list of event ids that exist on our class
sender()
Returns:instance which sent the event you are currently processing
Raises ValueError:
 if no event is currently in progress

Epydoc: mrv.maya.ui.util

Epydoc: mrv.maya.ui.util

Epydoc: mrv.maya.ui.util

Epydoc: mrv.maya.ui.util

Epydoc: mrv.maya.ui.util

Epydoc: mrv.maya.ui.util

class mrv.maya.ui.util.WeakInstFunction(instancefunction)

Bases: object

Create a proper weak instance to an instance function by weakly binding the instance, not the bound function object. When called, the weakreferenced instance pointer will be retrieved, if possible, to finally make the call. If it could not be retrieved, the call will do nothing.

Epydoc: mrv.maya.ui.util

Table Of Contents

Previous topic

mrv.maya.ui.dialog

Next topic

mrv.maya.ui.control

This Page