james_ has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

In wxWidgets it is simple to make a dialog modal (i.e. it blocks program flow until answered by clicking a button). However to make a custom dialog (i.e. frame with different widgets) we must use a Wx::Frame not Wx::Dialog.

The Wx::Frame does not support the ShowModal() command, so how does one get a Wx::Frame to be modal, or to suspend all program activity until answered?

I can't find any literature on this, so any suggestions would be appreciated! Thanks, James.

Replies are listed 'Best First'.
Re: Modal frame in wxPerl?
by eddw (Initiate) on Nov 25, 2008 at 15:03 UTC
    It is possible to subclass Wx::Dialog and do your own thing with it, just like you can subclass Wx::Frame. Is that what you wanted to do?
      Ahh, that's exactly right! Wx::Dialog does the trick. I was trying Wx::MessageDialog which doesn't allow for additional widgets.

      Thanks for the help! As a side note, when using Wx::Dialog, all widgets should be placed directly on the Dialog, not on a Wx::Panel on the Wx::Dialog. This is different to frames.