Re: [rt.cpan.org #99607] Issue using wxTextEntryBox

Steve Cookson - gmail <[email protected]>
Newsgroups gmane.comp.lang.perl.wxperl
Message-ID <[email protected]>
Hi Eric,
On 21-10-2014 09:20, Erik Colson via RT wrote:
> In conclusion: destroying $frame destroys $panel, but won't destroy $dialog, because it is_not_  the child of $panel.
> So, you are on your own to destroy the dialog with
>
> $dialog->Destroy;
>
> you can argue against this behaviour, but this is rather wxwidgets related and probably shouldn't be altered in wxPerl, assuming it can be.
Oh, very cool answer.  Nice logic.  So when you do OK, or Cancel the Box 
is not deleted.

I'm never quite sure when you need to delete it or not.

But when you leave scope, I guess it must be destroyed then?

Like this:

sub dosomething {
     $dialog = Wx::TextEntryDialog->new( $panel, 'Please Enter Text', 
'Dialog Header', "", wxOK|wxCANCEL, wxDefaultPosition );
     $dialog->Show(1);
     return;
}

Does it not get destroyed after "return"?

What difference does Show and ShowModal make?

Regards

Steve.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.