wxFilePickerCtrl(3erl)

✨ NAME ✨

okay so bestie, you opened the wxFilePickerCtrl(3erl) manual page β€” and it is literally Functions for the wxFilePickerCtrl class. That's the whole name sitch. 🫢

🌸 DESCRIPTION 🌸

This control is the moment when a user gets to select a file. The generic implementation is a button that brings up a wxFileDialog when you click it. Native implementations may differ, but usually it's a (small) widget that gives access to the file-chooser dialog. It's only available if wxUSE_FILEPICKERCTRL is set to 1 (the default). πŸ’…

πŸŽ€ Styles πŸŽ€

This class supports the following styles:

β€” and that's literally all this page says under Styles, bestie. No individual style names are listed here. πŸ’€

See: wxFileDialog, wxFileDirPickerEvent.

This class is derived (and can use functions) from: wxPickerBase, wxControl, wxWindow, wxEvtHandler.

wxWidgets docs: wxFileDialog.

πŸ’– EVENTS πŸ’–

Event types emitted from this class: command_filepicker_changed.

πŸ¦‹ DATA TYPES πŸ¦‹

wxFilePickerCtrl() = wx:wx_object()

πŸ‘‘ EXPORTS πŸ‘‘

new() -> wxFilePickerCtrl()

No arguments, just vibes. Returns a wxFilePickerCtrl(). ✨

new(Parent, Id) -> wxFilePickerCtrl()

Types:

Parent = wxWindow:wxWindow()
Id = integer()

new(Parent, Id, Options :: [Option]) -> wxFilePickerCtrl()

Types:

Parent = wxWindow:wxWindow()
Id = integer()
Option =
    {path, unicode:chardata()} |
    {message, unicode:chardata()} |
    {wildcard, unicode:chardata()} |
    {pos, {X :: integer(), Y :: integer()}} |
    {size, {W :: integer(), H :: integer()}} |
    {style, integer()} |
    {validator, wx:wx_object()}

Initializes the object and calls create/4 with all the parameters. πŸ› οΈ

create(This, Parent, Id) -> boolean()

Types:

This = wxFilePickerCtrl()
Parent = wxWindow:wxWindow()
Id = integer()

create(This, Parent, Id, Options :: [Option]) -> boolean()

Types:

This = wxFilePickerCtrl()
Parent = wxWindow:wxWindow()
Id = integer()
Option =
    {path, unicode:chardata()} |
    {message, unicode:chardata()} |
    {wildcard, unicode:chardata()} |
    {pos, {X :: integer(), Y :: integer()}} |
    {size, {W :: integer(), H :: integer()}} |
    {style, integer()} |
    {validator, wx:wx_object()}

Creates this widget with the given parameters.

Return: true if the control was successfully created or false if creation failed.

getPath(This) -> unicode:charlist()

Types:

This = wxFilePickerCtrl()

Returns the absolute path of the currently selected file. πŸ“

setPath(This, Filename) -> ok

Types:

This = wxFilePickerCtrl()
Filename = unicode:chardata()

Sets the absolute path of the currently selected file.

⚠️ caveat time, bestie: if the control uses wxFLP_FILE_MUST_EXIST and does not use wxFLP_USE_TEXTCTRL style, the filename must be a name of an existing file. If it isn't, the native wxGTK implementation will simply ignore it. (The generic implementation used under the other platforms currently accepts even invalid file names, but this is subject to change in the future β€” don't rely on being able to use non-existent paths with it.) 😭

destroy(This :: wxFilePickerCtrl()) -> ok

Destroys the object. Bye bestie. πŸ’€


Sign-off cuteness: this page was brought to you by the wxWidgets team, with source/version wx 2.2.2.1, and it's the wxFilePickerCtrl(3erl) page. (No separate date in this footer, so we're not inventing one, periodt.) 🫢

πŸ“¦ where this page comes from