470,811 Members | 1,030 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,811 developers. It's quick & easy.

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
Jul 5 '08 #1
2 1201
jlm699
314 100+
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:
Expand|Select|Wrap|Line Numbers
  1. if myDialog.ShowModal() == wx.ID_NO:
  2.      break # Leave this section of code
  3.  
Jul 7 '08 #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:
Expand|Select|Wrap|Line Numbers
  1. if myDialog.ShowModal() == wx.ID_NO:
  2.      break # Leave this section of code
  3.  
Thanks mate that solved it,
Jul 8 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by SeeBelow | last post: by
25 posts views Thread by BJörn Lindqvist | last post: by
1 post views Thread by timothy.williams | last post: by
1 post views Thread by James Stroud | last post: by
22 posts views Thread by Glurt Wuntal | last post: by
reply views Thread by Robin Dunn | last post: by
reply views Thread by Robin Dunn | last post: by
reply views Thread by Robin Dunn | last post: by
4 posts views Thread by stef | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.