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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:59:43+00:00 2026-06-02T23:59:43+00:00

I am very new to wxpython. I have a dialogue box where if the

  • 0

I am very new to wxpython. I have a dialogue box where if the user clicks ok then it should trigger an event. I am not sure as to how an event is bound to the button in the dialogue box. I tried using normal method calling but this was leading to a problem, When I close the application the program is not getting terminated at the terminal level.
I have tried using some thing like this.

def OnclickMe(self, event):

    dlg = wx.MessageDialog(None, 'Is this right', 'MessageDialog', wx.YES_NO | wx.ICON_QUESTION)
    result = dlg.ShowModal()
    if result == wx.ID_YES:
        self.IfYes()
    dlg.Destroy()
def IfYes(self):
    dlg = wx.TextEntryDialog(None, "Wats ur opinion?", 'A Question', '')
    if dlg.ShowModal() == wx.ID_OK:
        response = dlg.GetValue()

Please help.

  • 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-02T23:59:44+00:00Added an answer on June 2, 2026 at 11:59 pm

    When you call IfYes(), you pause the destruction of the first dialog until the second dialog is closed / destroyed. I think it will work if you destroy the TextEntryDialog though. Execution should return to the “if” statement and fall out of that, thus destroying the dialog. If you still have issues, try taking the IfYes() method call out of the conditional. Something like this should work:

    yes_or_no = False
    if result == wx.ID_YES:
        yes_or_no = True
    dlg.Destroy()
    if yes_or_no:
        self.IfYes()
    

    Yeah, it’s a hack, but I’m just curious if that works…

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

Sidebar

Related Questions

Am very new to Oracle triggers. Suppose I have a trigger on an insert
Very new to jQuery, if dupe question sorry at this point not even sure
I very new to Python, and fairly new to regex. (I have no Perl
Im very new to all coding including jquery. I though this would have been
Very new to this, and I have no idea where to start. I want
Very new to Business Objects, but I have a .NET background and PL/SQL background.
Very new to JS here. When I write PHP I have no problem assigning
Is it better to do it all at once? I'm very new to wxPython
Very new to Iphone development here, I have a project which is successfully building
Am very New to Web Page Development. In my website i have the help

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.