Package _Framework :: Module Layer :: Class Layer
[hide private]
[frames] | no frames]

Class Layer

source code

            object --+        
                     |        
     Resource.Resource --+    
                         |    
Resource.ExclusiveResource --+
                             |
                            Layer

A layer provides a convenient interface to control resources. In a layer, you can group several controls by name. The layer itself is an exclusive resource. When grabbing the layer, it will try to grab all controls and will forward them to its own owner when he receives them, and will take them from him when they are release. The layer with give and take away the controls from its client using methods of the form:

   client.set[control-name](control)

Where [control-name] is the name the control was given in this layer. This way, layers are a convenient way to provide controls to components indirectly, with automatic handling of competition for them.

Instance Methods [hide private]
 
__init__(self, *a, **controls)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
_get_priority(self) source code
 
_set_priority(self, priority) source code
 
__getattr__(self, name)
Provides access to controls
source code
 
set_control_element(self, control, grabbed)
Client interface of the ControlElement resource.
source code
 
grab(self, client, *a, **k) source code
 
on_grab(self, client, *a, **k)
Override from ExclusiveResource
source code
 
on_release(self, client)
Override from ExclusiveResource
source code

Inherited from Resource.ExclusiveResource: get_owner, release

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  priority

Inherited from Resource.Resource: owner

Inherited from object: __class__

Method Details [hide private]

__init__(self, *a, **controls)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

set_control_element(self, control, grabbed)

source code 

Client interface of the ControlElement resource. Please do not call this method directly, nor use a layer to grab controls directly -- do it implicitly by grabing the layer.

grab(self, client, *a, **k)

source code 
Overrides: Resource.Resource.grab

on_grab(self, client, *a, **k)

source code 

Override from ExclusiveResource

Overrides: Resource.ExclusiveResource.on_grab

on_release(self, client)

source code 

Override from ExclusiveResource

Overrides: Resource.ExclusiveResource.on_release

Property Details [hide private]

priority

Get Method:
_get_priority(self)
Set Method:
_set_priority(self, priority)