Home>

I want to display the file dialog with wxPython, but I want to change [Open (O)] to [Insert].
I couldn't find anything like that in the official documentation.

Please let me know if it is feasible with another library.

Corresponding source code
import wx
app = wx.App (False)
dlg = wx.FileDialog (None, "Please select the file I want to insert", "", "", "All formats | *. *", Style = wx.FD_OPEN)
if dlg.ShowModal () == wx.ID_OK:
    path = dlg.GetPath ()
    #######################
    #abridgement
    #######################
dlg.Destroy ()
What I tried

Google search

Supplementary information (FW/tool version, etc.)

Python 3.8
Windows 10

  • Answer # 1

    Platform-specific dialogs cannot be modified from wxPython.

    It looks different, but
    wx.FileCtrlSince the component of the file selection part is provided in
    You will create your own file selection dialog in combination with dialogs and buttons.


    In another library, the selection of GUI library itself will change.
    For Qt, you can change it to your own file selection dialog with the DontUseNativeDialog flag.
    Since each widget is implemented in Qt, you can change the characters of the buttons.

    * WxWidgets also has wxGenericFileDialog implemented by wx,
    I couldn't find any usage from wxPython.