pycocoa.geometry.Size

Package pycocoa :: Module geometry :: Class Size |
[frames] | no frames]

# Class Size

      object --+
               |
    bases._Type0 --+
                   |
                  Size

Known Subclasses:
  - Size2

Python Type, wrapping an ObjC `NSSize_t`.

Instance Methods
__init__(self, size) New Size from another Size, `list`, `tuple` or `NSSize_t`. |
__str__(self) str(x) |
Inherited from `bases._Type0`: `__repr__`, `type2strepr` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
| height Get the height (`float` or `int`).
| ratio Get the aspect ratio as 2-tuple (width, height).
| size Get the width, height (2-tuple) of (`float` or `int`).
| width Get the width (`float` or `int`).
Inherited from `bases._Type0`: `NS`, `NSDelegate` Inherited from `object`: `__class__`

Method Details

### __init__(self, size) (Constructor) |
New Size from another Size, `list`, `tuple` or `NSSize_t`. Overrides: object.__init__

### __str__(self) (Informal representation operator) |
str(x) Overrides: object.__str__ (inherited documentation)

Property Details

### height Get the height (`float` or `int`). Get Method: height(self) - Get the height (`float` or `int`). Set Method: height(self, height) - Set the height (`float` or `int`).

### ratio Get the aspect ratio as 2-tuple (width, height). Get Method: ratio(self) - Get the aspect ratio as 2-tuple (width, height). Set Method: ratio(self, ratio) - Adjust width and/or height to the given aspect ratio.

### size Get the width, height (2-tuple) of (`float` or `int`). Get Method: size(self) - Get the width, height (2-tuple) of (`float` or `int`). Set Method: size(self, size) - Set the size (Size, `list`, `tuple` or `NSSize_t`).

### width Get the width (`float` or `int`). Get Method: width(self) - Get the width (`float` or `int`). Set Method: width(self, width) - Set the width (`float` or `int`).