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 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

I'm trying to execute two events using the same class in jquery... having one
I need to use two extension methods SqlCommandExtensions & SqlConnectionExtensions http://msdn.microsoft.com/en-us/library/microsoft.practices.enterpriselibrary.windowsazure.transientfaulthandling.sqlazure(v=pandp.50).aspx Here they say
As the question states, I have two ethernet devices I need to use. A
I need to merge two bitmaps to use the resulting bitmap as a mask.
I have two views (for simplicity sake), one called Events, one called Friends. Their
I have a need to send a message to a number of people to
I'm using a piece of JS twice for two, different yet the same, events.
If one doesn't use Threads or Timers , they wouldn't need synch, as all
I need use this method with three distinct classes: Orders, Customers, Suppliers public void
I need use this code: <%= button_tag :class => btn btn-primary do %> <%=

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.