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

  • Home
  • SEARCH
  • 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 4103534
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:58:15+00:00 2026-05-20T20:58:15+00:00

I need to use two events to send a message from child frame to

  • 0

I need to use two events to send a message from child frame to main frame and close the child frame (by using pubsub). One of the events is the click event of a “Cancel” button on the child frame and the other one is the close event of the child frame. So I use a common “OnClose” function for both of them. Here is my related code:

self.Bind(wx.EVT_BUTTON, self.OnClose, id=cancel.GetId())

self.Bind( wx.EVT_CLOSE, self.OnClose )

def OnClose(self, event):
    self.Close()
    Pubsub().sendMessage(("show.mainframe"),"")`

Every time I close my child frame, it actually doesnt close and when I try to reopen the child frame from the main frame, a new child frame is generated on top of the previous one.
Actually I solved this problem by using the code inside the destructor function (del). But I am curious why in the first method it doesnt work.

Thanks in advance.

  • 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-20T20:58:16+00:00Added an answer on May 20, 2026 at 8:58 pm

    Try reversing the order of your calls in your OnClose method. Put the pubsub call first and the Close call last. Or just use Destroy() at the end instead of Close().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why do I need two of them? When I have to use one or
I'm trying to execute two events using the same class in jquery... having one
Suppose you have two seperate ASP.NET Web Application projects that both need to use
I need to use NSImage which appears need to be imported from <AppKit/AppKit.h> .
I need to use sendmail from Macs in an office. At the moment, I
I need to have some object hanging around between two events I'm interested in:
I need to use sed to convert all occurences of ##XXX## to ${XXX} .
I need to use an alias in the WHERE clause, but It keeps telling
I need to use a many to many relationship in my project and since
I need to use a byte array as a profile property in a website.

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.