Package pype :: Module filebox :: Class FileDialog
[frames] | no frames]

Class FileDialog

source code

object --+
         |
        FileDialog

Standard file selection dialog -- no checks on selected file.

Usage:

d = FileDialog(master) file = d.go(initialdir, pattern, initialfile, key) if file is None: ...canceled... else: ...open file...

All arguments to go() are optional.

The 'key' argument specifies a key in the global dictionary 'dialogstates', which keeps track of the values for the directory and pattern arguments, overriding the values passed in (it does not keep track of the initialfile argument!). If no key is specified, the dialog keeps no memory of previous state. Note that memory is kept even when the dialog is canceled. (All this emulates the behavior of the Macintosh file selection dialogs.)

Instance Methods
 
__init__(self, master=None, title=None, text=None, sortfn=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
go(self, initialdir=os.curdir, pattern="*", initialfile="", key=None) source code
 
quit(self, how=None) source code
 
dirs_double_event(self, event) source code
 
dirs_select_event(self, event) source code
 
files_double_event(self, event) source code
 
files_select_event(self, event) source code
 
ok_event(self, event) source code
 
ok_command(self) source code
 
filter_command(self, event=None) source code
 
get_filter(self) source code
 
get_selection(self) source code
 
cancel_command(self, event=None) source code
 
set_filter(self, dir, pat) source code
 
set_selection(self, file) source code

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

Class Variables
  title = "File Selection"
Properties

Inherited from object: __class__

Method Details

__init__(self, master=None, title=None, text=None, sortfn=None)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)