File: overlay_container.py

package info (click to toggle)
python-enable 3.3.1-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 10,392 kB
  • ctags: 17,135
  • sloc: cpp: 79,151; python: 29,601; makefile: 2,926; sh: 43
file content (25 lines) | stat: -rw-r--r-- 729 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25


from container import Container
from simple_layout import simple_container_get_preferred_size, \
    simple_container_do_layout

class OverlayContainer(Container):
    """ A container that stretches all its components to fit within its space.
    All of its components must therefore be resizable.
    """

    def get_preferred_size(self, components=None):
        """ Returns the size (width,height) that is preferred for this component.
 
        Overrides PlotComponent
        """
        return simple_container_get_preferred_size(self, components=components)

    def _do_layout(self):
        """ Actually performs a layout (called by do_layout()).
        """
        simple_container_do_layout(self)
        return