FilePickerCtrl

A simple file and path picker widget consisting of a text field and a button.

class core.FilePickerCtrl.FilePickerCtrl(parent, id=-1, startDir='', mode='path', **kwargs)[source]

FilePickerCtrl is a simple file picker widget for wxPython consisting of a text-field and a ‘select file’-button.

Parameters:
  • parent (wxWindow) – Parent window.
  • id (int) – Widget it (default=-1).
  • startDir (str) – Initial directory to display in search dialog (default=’’ for current).
  • mode (str) – Type of dialog (‘open’, ‘save’, ‘path’ = default).
  • kwargs – Other parameters that are passed on to the wxPanel constructor.
Disable()[source]

Disable widget.

Enable(value=True)[source]

Enable or disable widget when value is True (default) or False.

GetSize()[source]

Return wxSize-object containing widget dimensions.

GetValue()[source]

Return selected path.

SetSize(w, h=None)[source]

Set widget size.

Parameters:
  • w (mixed) – Width in pixel if h is not None. Otherwise tuple containing width and height.
  • h (int) – Height in pixel (default=None).
SetValue(value)[source]

Set current path.

onBrowse(event)[source]

Handle the button click event by displaying a file or path dialog.

Emits a FileSelectEvent when the user clicks OK.