# -*- coding: utf-8 -*-#
#!/usr/bin/env python

import wx


class MyDialog(wx.Dialog):
    def __init__(self, parent, **kwds):
        super(MyDialog, self).__init__(parent, style=wx.MINIMIZE_BOX|wx.MAXIMIZE_BOX|\
                                       wx.RESIZE_BORDER|wx.DEFAULT_DIALOG_STYLE,
                                       title=u"A title",
                                       **kwds)

        self.bPressed = wx.ID_YES
        self.SetSizerAndFit(self.CreateButtonSizer(wx.YES|wx.NO))
        
        self.Bind(wx.EVT_BUTTON, self.onNoButton, id=wx.ID_NO)
        
    def onNoButton(self, evt):
        evt.Skip()
        self.bPressed = wx.ID_NO
        self.Close()

if __name__ == '__main__':
    import wx.lib.mixins.inspection as wit
    app = wit.InspectableApp(redirect=False)

    with MyDialog(None) as dlg:
        result = dlg.ShowModal()
        if dlg.bPressed == wx.ID_NO:
            print 'no'
        elif dlg.bPressed == wx.ID_YES:
            print 'yes'
        else:
            print bPressed
            print result

    app.MainLoop()
