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 7991497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:18:26+00:00 2026-06-04T13:18:26+00:00

the app is very simple, only having two windows: when i click on the

  • 0

the app is very simple, only having two windows: when i click on the search button, a new window will show out. but when i close the child and the parent window one by one, i found the app not exit at all(the IDLE told me that there was still something running)

#coding=utf8
import wx
SearchResult = ""
Name = ""
minPrice = 0
maxPrice = 0

class Output(wx.Frame):
    def __init__(self, parent, title):
        wx.Frame.__init__(self,parent,-1,title,size = (300,600))
        panel2 = wx.Panel(self,-1)
        Result = wx.StaticText(panel2,-1,SearchResult,pos = (20,20),size=(260,560))

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

    def OnAppClose(self, evt):
        msg = "Hold on there a minute"
        dlg = wx.MessageDialog(None, msg, "Wait ...", 
            wx.YES_NO | wx.ICON_EXCLAMATION)

        if dlg.ShowModal() == wx.ID_YES:
            self.Destroy()
        else:
            return

        dlg.Destroy()

class TextCtrlFrame(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self,None,-1,u'crawl',size = (600,300))
        panel = wx.Panel(self,-1)
        Label1 = wx.StaticText(panel,-1,u"name",pos = (30,20))
        self.inputText1 = wx.TextCtrl(panel,-1,"",pos = (90,20),size=(150,-1))
        self.inputText1.SetInsertionPoint(0)
        Label2 = wx.StaticText(panel,-1,u"price",pos = (270,20))
        self.inputText2 = wx.TextCtrl(panel,-1,"",pos = (330,20),size=(60,-1))
        Label3 = wx.StaticText(panel,-1,"----",pos = (400,20))
        self.inputText3 = wx.TextCtrl(panel,-1,"",pos = (430,20),size=(60,-1))
        self.button = wx.Button(panel, -1, u"search",pos = (250,230))
        self.Bind(wx.EVT_BUTTON,self.OnClick,self.button)
    def OnClick(self,event):
        Name = self.inputText1.GetValue()
        minPrice = self.inputText2.GetValue()
        maxPrice = self.inputText3.GetValue()
        SearchResult = Name + minPrice + maxPrice

        app2 = wx.App()
        frame2 = Output(self,u'result')
        frame2.Show()
        app2.MainLoop()

if __name__ == "__main__":  
    app = wx.App()
    frame = TextCtrlFrame()
    frame.Show()
    app.MainLoop()

any help appreciated.

  • 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-06-04T13:18:27+00:00Added an answer on June 4, 2026 at 1:18 pm

    First, you are starting two wx.Applications and mainLoops in your program. This is not needed.

    Modify:

        app2 = wx.App()
        frame2 = Output(self,u'result')
        frame2.Show()
        app2.MainLoop()
    

    with

        frame2 = Output(self,u'result')
        frame2.Show()
    

    The Living Dead seems to be the MessageDialog that is working in its own loop.
    You can fix this nasty problem in two ways:

    1.- Do not hesitate and kill it mercilessly:

        if dlg.ShowModal() == wx.ID_YES:
            dlg.Destroy()
            self.Destroy()
    

    2.- Better, make it a child of the frame in order to be automatically and fully killed, without possibility of resuscitation in any creepy form, when the frame is closed (Note the self):

         dlg = wx.MessageDialog(self, msg, "Wait ...", wx.YES_NO|wx.ICON_EXCLAMATION)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My WPF test app (very simple, just one window) is using a 3rd party
I try to create a very simple app using windows API. I've done some
I have a very simple webforms app that will allow field techs to order
I have a very simple test app just to play around with Windows Phone
I have a very simple Rails app with a very simple relational database: Category
I have lately been developing a very simple app for iOS with PhoneGap. All
I am trying to learn Android app development and wrote a very simple app
Good morning, A bit of background might help. I'm creating a very simple app
I have a very simple iPhone app that requires a random integer from 1-100.
I have a very simple Mac Cocoa app that just has a Web View

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.