wxpython

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • askalottaqs
    New Member
    • Jun 2007
    • 75

    wxpython

    I have a confirmation dialog in wxpython, i want the code to continue or not ( go to the next line after it) based on if the answer to the dialog is yes or no.

    When i run the code it goes on without waiting for the input returned from the dialog, so how can i halt the code to wait for that input and continue!?

    I know i could place the code that is below that confirmation statement into a function that checks the value of the of that dialog and runs, but i figure its just a confirmation message and i want the code to stay tidy without functions lying all around,

    any help is appreciated

    thanks
  • jlm699
    Contributor
    • Jul 2007
    • 314

    #2
    You should check the return from the ShowModal() call. This will differ depending on the makeup of your dialog buttons. But if it's a simple yes/no then you would check for wx.ID_YES or wx.ID_NO. It would look like this:
    [code=python]
    if myDialog.ShowMo dal() == wx.ID_NO:
    break # Leave this section of code
    [/code]

    Comment

    • askalottaqs
      New Member
      • Jun 2007
      • 75

      #3
      Originally posted by jlm699
      You should check the return from the ShowModal() call. This will differ depending on the makeup of your dialog buttons. But if it's a simple yes/no then you would check for wx.ID_YES or wx.ID_NO. It would look like this:
      [code=python]
      if myDialog.ShowMo dal() == wx.ID_NO:
      break # Leave this section of code
      [/code]
      Thanks mate that solved it,

      Comment

      Working...