dialog message with only cancel button

I want to make a cancel dialog …

but im really stranged that this isnt working:

mensajeA = wx.MessageDialog(None,

‘random’, ‘random’

‘Atention’,

wx.CANCEL | wx.ICON_EXCLAMATION |

wx.STAY_ON_TOP

)

if mensajeA.ShowModal():

dosomething()

Searched on google and seems like this is a problem in the windows enviroment or something … any1 can point out a sollution or some elegant workaround? … thanks

···


monoBOT

Visite mi sitio(Visit my site): monobotblog.alvarezalonso.es

I want to make a cancel dialog ...

but im really stranged that this isnt working:

mensajeA = wx.MessageDialog(None,
                'random', 'random'
                'Atention',
                wx.CANCEL | wx.ICON_EXCLAMATION |
                wx.STAY_ON_TOP
                )
if mensajeA.ShowModal():
    dosomething()

What is not working? Are you getting an exception or .........?

Looking at the doc I would code it like this:

wx.MessageDialog(None, 'your message', caption='your caption',
                                  style=wx.CANCEL | wx.ICON_EXCLAMATION

wx.STAY_ON_TOP)

Werner

···

On 25/02/2012 12:48, monoBOT wrote:

The problem friend Werner is that the dialog isnt showing a Cancel Button but an Ok button …

just that

···


monoBOT

Visite mi sitio(Visit my site): monobotblog.alvarezalonso.es

O.K.:wink: , note that you still have one to many strings, and as I always get confused which one is the caption and which one is the message I use the keyword method, a little bit more typing but ...

You can not just have a cancel button, which is documented, see the following links.

http://xoomer.virgilio.it/infinity77/wxPython/Widgets/wx.MessageDialog.html
http://docs.wxwidgets.org/trunk/classwx_message_dialog.html

If you just want a cancel button you could use the wx.lib.agw.genericmessagedialog, check out the wxPython demo.

Werner

···

On 25/02/2012 21:40, monoBOT wrote:

The problem friend Werner is that the dialog isnt showing a Cancel Button but an Ok button ...

just that