Hello, this is my first post here, and I'm having some trouble with Python.
I'm actually using wxPython the issue is, I've created a Dialog with wx.MessageDialog(....), and it displays and everything, i just don't know how to interact with it, I mean:
-Dialog
|Yes|No|
If I click yes, it closes, if I click No it closes, how do I make those buttons actually do something?.
I think what I'm looking for is some kind of return value so in that case I would be able to do:
if dialog.returnValue == Ok:
do this
I've searched trough Google but I didn't find anything and wxpython wiki seems to be down.
So.. any ideas?
Without knowing wxPython I can't be sure, but I don't see why you can't just have this:
I would think that the ShowModal function itself would return the value from the Dialog, since execution effectively stops there and waits for a user response. However, I have no way to know what ShowModal would return.Code:mdialog = wx.MessageDialog(None, "What's new with you?", wx.YES_NO | wx.ICON_QUESTION) retvalue = mdialog.ShowModal()
Next time download the docs!![]()
Wow I changed my sig!
Thanks for your answer, anyway, wxPython wiki is back online and I was able to solve the problem it was something like:
So thanks anywayCode:if Dialog.ShowModal() == wx.ID_YES: print "You pressed Yes" else: print "You pressed No"
BTW is there really some method to download documentation? because I've searched but didn't find anything.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks