Package fife :: Package extensions :: Module filebrowser :: Class FileBrowser
[hide private]
[frames] | no frames]

Class FileBrowser

source code

object --+
         |
        FileBrowser

The FileBrowser displays directory and file listings from the vfs.

The fileSelected parameter is a callback invoked when a file selection has been made; its signature must be fileSelected(path,filename).

If selectdir is set, fileSelected's filename parameter should be optional.

The savefile option provides a box for supplying a new filename that doesn't exist yet.

The selectdir option allows directories to be selected as well as files.

Instance Methods [hide private]
 
__init__(self, engine, fileSelected, savefile=False, selectdir=False, extensions=('xml',), guixmlpath="gui/filebrowser.xml")
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
showBrowser(self)
create and / or show the gui
source code
 
setDirectory(self, path)
sets the current directory according to path
source code
 
_selectDir(self)
callback for directory ListBox
source code
 
_selectFile(self)
callback for selectButton, hides filebrowser
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, engine, fileSelected, savefile=False, selectdir=False, extensions=('xml',), guixmlpath="gui/filebrowser.xml")
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • engine (object) - initiated instance of FIFE
  • fileSelected (function) - callback invoked on file selection
  • savefile (bool) - flag to provide a gui for an usergiven filename
  • selectdir (bool) - flag to fire fileSelected without filename
  • extensions (tuple) - list of extensions the filebrowser should show (defaults to xml)
  • guixmlpath (string) - path to the xml guifile defaults to (gui/filebrowser.xml)
Overrides: object.__init__