A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://wxpython.org/Phoenix/docs/html/wx.FilePickerCtrl.html below:

wx.FilePickerCtrl — wxPython Phoenix 4.2.4a1 documentation

wx.FilePickerCtrl¶

This control allows the user to select a file.

The generic implementation is a button which brings up a wx.FileDialog when clicked. Native implementation may differ but this is usually a (small) widget which give access to the file-chooser dialog. It is only available if USE_FILEPICKERCTRL is set to 1 (the default).

Window Styles¶

This class supports the following styles:

Events Emitted by this Class¶

Handlers bound for the following event types will receive a wx.FileDirPickerEvent parameter.

Class Hierarchy¶

Inheritance diagram for class

FilePickerCtrl

:

Control Appearance¶ Methods Summary¶ Properties Summary¶ Class API¶
class wx.FilePickerCtrl(PickerBase)¶

Possible constructors:

FilePickerCtrl() -> None

FilePickerCtrl(parent, id=ID_ANY, path='',
               message=FileSelectorPromptStr, wildcard=FileSelectorDefaultWildcardStr,
               pos=DefaultPosition, size=DefaultSize, style=FLP_DEFAULT_STYLE,
               validator=DefaultValidator, name=FilePickerCtrlNameStr) -> None

This control allows the user to select a file.


Methods¶
__init__(self, *args, **kw)¶

Overloaded Implementations:

__init__ (self)

Return type:

None

__init__ (self, parent, id=ID_ANY, path=’’, message=FileSelectorPromptStr, wildcard=FileSelectorDefaultWildcardStr, pos=DefaultPosition, size=DefaultSize, style=FLP_DEFAULT_STYLE, validator=DefaultValidator, name=FilePickerCtrlNameStr)

Initializes the object and calls Create with all the parameters.

Parameters:
Return type:

None



Create(self, parent, id=ID_ANY, path='', message=FileSelectorPromptStr, wildcard=FileSelectorDefaultWildcardStr, pos=DefaultPosition, size=DefaultSize, style=FLP_DEFAULT_STYLE, validator=DefaultValidator, name=FilePickerCtrlNameStr)¶

Creates this widget with the given parameters.

Parameters:
  • parent (wx.Window) – Parent window, must not be not None.

  • id (wx.WindowID) – The identifier for the control.

  • path (string) – The initial file shown in the control. Must be a valid path to a file or the empty string.

  • message (string) – The message shown to the user in the wx.FileDialog shown by the control.

  • wildcard (string) – A wildcard which defines user-selectable files (use the same syntax as for wx.FileDialog’s wildcards).

  • pos (wx.Point) – Initial position.

  • size (wx.Size) – Initial size.

  • style (long) – The window style, see FLP_ flags.

  • validator (wx.Validator) – Validator which can be used for additional data checks.

  • name (string) – Control name.

Return type:

bool

Returns:

True if the control was successfully created or False if creation failed.


static GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)¶
Parameters:

variant (WindowVariant)

Return type:

wx.VisualAttributes


GetPath(self)¶

Returns the absolute path of the currently selected file.

Return type:

str


SetInitialDirectory(self, dir)¶

Set the directory to show when starting to browse for files.

This function is mostly useful for the file picker controls which have no selection initially to configure the directory that should be shown if the user starts browsing for files as otherwise the directory of initially selected file is used, which is usually the desired behaviour and so the directory specified by this function is ignored in this case.

Parameters:

dir (string)

Return type:

None

Added in version 2.9.4.


SetPath(self, filename)¶

Sets the absolute path of the currently selected file.

If the control uses FLP_FILE_MUST_EXIST and does not use FLP_USE_TEXTCTRL style, the filename must be a name of an existing file and will be simply ignored by the native wxGTK implementation if this is not the case (the generic implementation used under the other platforms accepts even invalid file names currently, but this is subject to change in the future, don’t rely on being able to use non-existent paths with it).

Parameters:

filename (string)

Return type:

None


Properties¶
Path¶

See GetPath and SetPath


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4