Package pycocoa :: Module panels :: Class OpenPanel
[frames] | no frames]

Class OpenPanel

          object --+                
                   |                
internals._Objectype --+            
                       |            
        baseTypes._Type0 --+        
                           |        
            baseTypes._Type1 --+    
                               |    
                baseTypes._Type2 --+
                                   |
                                  OpenPanel

Python Type to select a file, wrapping ObjC NSOpenPanel.

Instance Methods
 
__init__(self, title='')
New OpenPanel, a file selection dialog.
 
pick(self, filetypes, aliases=False, dirs=False, files=True, hidden=False, hidexts=False, multiple=False, packages=False, prompt='', otherOK=False, dflt=None)
Select a file from the panel.

Inherited from baseTypes._Type2: __str__

Inherited from baseTypes._Type0: __repr__, type2strepr

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

Properties

Inherited from baseTypes._Type2: title

Inherited from baseTypes._Type1: NSdelegate, app

Inherited from baseTypes._Type0: NS, NSDelegate

Inherited from internals._Objectype: typename

Inherited from object: __class__

Method Details

__init__(self, title='')
(Constructor)

 

New OpenPanel, a file selection dialog.

Parameters:
  • title - The panel name (str).
Overrides: object.__init__

pick(self, filetypes, aliases=False, dirs=False, files=True, hidden=False, hidexts=False, multiple=False, packages=False, prompt='', otherOK=False, dflt=None)

 

Select a file from the panel.

Parameters:
  • filetypes - The selectable file types (tuple of str-s).
  • aliases - Allow selection of aliases (bool).
  • dirs - Allow selection of directories (bool).
  • hidden - Allow selection of hidden files (bool).
  • hidexts - Hide file extensions (bool).
  • multiple - Allow selection of multiple files (bool).
  • packages - Treat file packages as directories (bool).
  • prompt - The button label (str), default "Open".
  • otherOK - Allow selection of other file types (bool).
  • dflt - Return value, if cancelled, nothing selected (None).
Returns:
The selected file name path (str) or dflt.