Package pycocoa :: Module tables :: Class Table
[frames] | no frames]

Class Table

  object --+            
           |            
bases._Type0 --+        
               |        
    bases._Type1 --+    
                   |    
        bases._Type2 --+
                       |
                      Table

Python rows and columns {Table} Type, wrapping an ObjC NSTableView.

Instance Methods
 
__init__(self, *headers)
New Table.
 
append(self, *cols)
Append another row of column values.
 
close(self)
Close and release this table.
 
display(self, title, width=400, height=300)
Show the table in a scrollable window.
 
separator(self)
Append a row separator, an empty row.

Inherited from bases._Type2: __str__

Inherited from bases._Type0: __repr__, type2strepr

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

Properties

Inherited from bases._Type2: title

Inherited from bases._Type1: NSdelegate, app

Inherited from bases._Type0: NS, NSDelegate

Inherited from object: __class__

Method Details

__init__(self, *headers)
(Constructor)

 

New Table.

Parameters:
  • headers - Column headers (str), either just the "title" or "title:width" to specify the column width (int or float), ":bold" and/or :italic" to specify the font trait and ":center", ":justified", ":left", ":natural" or ":right" to set the text alignment.
Overrides: object.__init__

Note: Capitalize font ":Trait" and text ":Alignment" to change the header row.

display(self, title, width=400, height=300)

 

Show the table in a scrollable window.

Parameters:
  • title - Window title (str).
  • width - Window frame width (int or float).
  • height - Window frame height (int or float).
Returns:
The window (TableWindow).
Raises:
  • ValueError - Invalid header column ":width", font ":trait" or text ":alignment".