Here http://trac.wxwidgets.org/ticket/11413 I see that the issue with NO
buttons made with CreateButtonSizer() not working is a known issue. What is
the best work around to have ShowModal() return wx.ID_NO when these buttons
are pressed?
Here wxTrac has been migrated to GitHub Issues - wxWidgets I see that the issue with NO
buttons made with CreateButtonSizer() not working is a known issue. What is
the best work around to have ShowModal() return wx.ID_NO when these buttons
are pressed?
Save it in a variable and check that see attached.
Frankly I was surprised that "result" after clicking on "No" in the attached was "wx.ID_YES" and not "wx.ID_NO" therefore the variable.
Thank you that would work, but wouldn't using self.EndModal(wx.ID_NO) in the
bound event be cleaner? That is what I have been using, but I wanted to know
if there was some common standard method in case there is some problem with
EndModal() that I did not know about.
I'm using a class that takes the button combination in the constructor, so
keeping a default value in that way would need to be more complicated with
three or more buttons.
Thank you that would work, but wouldn't using self.EndModal(wx.ID_NO) in the
bound event be cleaner?
Yes, I didn't know about that one.
That is what I have been using, but I wanted to know
if there was some common standard method in case there is some problem with
EndModal() that I did not know about.
I'm using a class that takes the button combination in the constructor, so
keeping a default value in that way would need to be more complicated with
three or more buttons.
I am not sure I understand, sure the more buttons the more options/complicated.
What has the default value to do here?
If you use a common button handler you could maybe use this "EndModal(evt.GetId())".