Tue Oct 21 11:15:01 2014: Request 99607 was acted upon.
Transaction: Correspondence added by pwnbusiness2...@centurylink.net
       Queue: Wx
     Subject: Re: [rt.cpan.org #99607] Issue using wxTextEntryBox
   Broken in: (no value)
    Severity: (no value)
       Owner: Nobody
  Requestors: pwnbusiness2...@centurylink.net
      Status: open
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=99607 >


Isn't the "parent" parameter in the call to the "new" method the parent window?

----- Original Message -----
From: "Erik Colson via RT" <bug...@rt.cpan.org>
To: pwnbusiness2...@centurylink.net
Sent: Tuesday, October 21, 2014 4:20:44 AM
Subject: [rt.cpan.org #99607] Issue using wxTextEntryBox

<URL: https://rt.cpan.org/Ticket/Display.html?id=99607 >

On Tue Oct 21 02:26:08 2014, ecocode wrote:
> Hi Patrick,
> 
> Add this line after the dialog creation and try again. You might
> understand what is happening.
> 
> $dialog->Show(1);

I'll explain my point of view on this:

Wx::TextEntryBox is a 'convenience' Dialog which, although 'parent' aught to be 
defined in the constructor, the dialog is not added as a children to the 
parent. Reason for this is that $dialog has no wxwindow ID (look at the 
constructor params). Therefor it can't be added as a children to any wx 
container.  This kind of dialogs are ment to be used in procedures where they 
are shown modally, and then destroyed.

You can use DDP to show the relation to other widgets i.e.:
use DDP;
p $frame->GetChildren;   # should show the panel as a children
p $panel->GetChildren;   # doesn't show the dialog as a children

also try 
p $panel;
p $dialog;

which illustrates the internal difference between both.

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.
-- 
Erik

Reply via email to