Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1018371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:50:52+00:00 2026-05-16T10:50:52+00:00

in wxpython, is there a event that can occur when one of the function

  • 0

in wxpython, is there a event that can occur when one of the function of the panel or frame is called? thanks; for example, self.Bind(wx.EVT_Onfunctioncalled, self.OnDoSomething)

Well, I have to changed this question to a more specific one as follows:

I mean, well, the following process: I click on the menu “file” on the main window (as most GUI application looks), then “open”, then a file directory dialog pops up, then I select a file, then I click “okay” on that dialog, then, I want that this file’s name would appear on the listctrl on this main window, displaying which file I had select

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T10:50:53+00:00Added an answer on May 16, 2026 at 10:50 am

    Here’s a runnable example that does what you want.

    import wx
    
    class ListTest(wx.Frame):
        def __init__(self, parent, title):
            wx.Frame.__init__(self, parent, -1, title, size=(380, 230))          
            panel = wx.Panel(self, -1)
    
            #Create a list                
            self.list = wx.ListCtrl(panel, -1, style=wx.LC_REPORT) 
            self.list.InsertColumn(0, 'File-path', width=140)
    
            #Do the layout
            hbox = wx.BoxSizer(wx.HORIZONTAL)
            hbox.Add(self.list, 1, wx.EXPAND)
            panel.SetSizer(hbox)
            self.Centre()
            self.Show(True)
    
            #Create Menu
            menubar = wx.MenuBar()
            file = wx.Menu()
            self.loadFile = wx.MenuItem(file, -1, '&Open\tCtrl+L', 'Open a file')
            file.AppendItem(self.loadFile)
            menubar.Append(file, '&File')
            self.SetMenuBar(menubar)
    
            self.Bind(wx.EVT_MENU, self.on_openFile)
    
    
        def on_openFile(self, evt):
            loadFileDlg = wx.FileDialog(
                self, message="Open File",
                defaultDir="",
                defaultFile="",
                style=wx.OPEN | wx.CHANGE_DIR
                )
            #If the user clicked the open file button
            if loadFileDlg.ShowModal() == wx.ID_OK:          
                #Get the file path
                path = loadFileDlg.GetPath()
            loadFileDlg.Destroy()
    
            #Call your file analysis method or whatever here
    
            #Create a message dialog 
            fileAnalysedDlg = wx.MessageDialog(self, "File Has Been Analysed", "File Has Been Analysed", wx.OK)   
            fileAnalysedDlg.ShowModal()
            fileAnalysedDlg.Destroy()
    
            #Add filepath to list
            self.list.InsertStringItem(0, path)
    
    
    app = wx.App()
    ListTest(None, 'list test')
    app.MainLoop()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 497k
  • Answers 497k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Considering your database layout, I think it might be better… May 16, 2026 at 11:53 am
  • Editorial Team
    Editorial Team added an answer width="350px" px is CSS. No px when using the HTML… May 16, 2026 at 11:53 am
  • Editorial Team
    Editorial Team added an answer The performance difference will most likely be miniscule in this… May 16, 2026 at 11:53 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a wxPython app which has many worker threads, idle event cycles, and
I have a wxPython application ( http://www.OpenSTV.org ) that counts ballots using methods that
Suppose I develop an application with the logic as a CLI program that can
I'd like to create a ListBox in wxPython with the same semantics as a
I'm starting out with wxPython and have been working my way through every tutorial
I'm just starting out with wxPython and this is what I would like to
I'm working on a form using wxPython where I want want listctrl's list of
okay code: #!/usr/bin/python import wx import sys class XPinst(wx.App): def __init__(self, redirect=False, filename=None): wx.App.__init__(self,
I have a wxpython app designed using XRC which has a multiline textctrl inside
Is it possible to customize ProgressDialog in wxPython? For instance, I would like to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.