wx.MessageDialog displayed without components inside

P

perchef

Is there a reason why a wx.MessageDialog would be displayed without
components inside ?

this :

md = wx.MessageDialog(None,'foo','bar',wx.YES_NO)
result = md.ShowModal()
md.Destroy()

In my application, give me :
http://img252.imageshack.us/my.php?image=messagedialog6nw.jpg

This isn't a bug in wxPython because when I use the same code in
pyshell I obtain the expected result. So, there must be a reason but I
can't figure out why.

Thanks.
 
S

stas

Is there a reason why a wx.MessageDialog would be displayed without
components inside ?

this :

md = wx.MessageDialog(None,'foo','bar',wx.YES_NO)
Here you create a dialog
result = md.ShowModal()
Now you show it
md.Destroy()
But right after showing it, you destroy it.
In my application, give me :
http://img252.imageshack.us/my.php?image=messagedialog6nw.jpg

This isn't a bug in wxPython because when I use the same code in
pyshell I obtain the expected result. So, there must be a reason but I
can't figure out why.
Because in the shell you first have to type the Destroy call
so the dialog has some time to live. :)

Stas
 
P

perchef

nope, I have put md.Destroy() away and it didn't change something.
I don't think that's the problem because ShowModal() is a blocking
method, execution is stop until you press YES or NO (in my case with
wx.YES_NO)
 
S

stas

nope, I have put md.Destroy() away and it didn't change something.
I don't think that's the problem because ShowModal() is a blocking
method, execution is stop until you press YES or NO (in my case with
wx.YES_NO)
Just a thought, do you cal the event loop ?
Because this minimal example just works like it should.

import wx
app = wx.PySimpleApp()
md = wx.MessageDialog(None,'foo','bar',wx.YES_NO)
result = md.ShowModal()
app.MainLoop()

Stas
 
P

perchef

Just a thought, do you call the event loop ?
yes i do.
I really can't see my a MessageDialog would appear without components
inside. maybe a thread problem ?
 
S

stas

yes i do.
I really can't see my a MessageDialog would appear without components
inside. maybe a thread problem ?
Does the example I gave work?
I mean when you copy and paste it does it show a normal dialog?

Stas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top