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

"Patrick via RT" <[email protected]>
Newsgroups gmane.comp.lang.perl.wxperl
Message-ID <[email protected]>
Tue Oct 21 16:16:09 2014: Request 99607 was acted upon.
Transaction: Correspondence added by [email protected]
       Queue: Wx
     Subject: Re: [rt.cpan.org #99607] Issue using wxTextEntryBox
   Broken in: (no value)
    Severity: (no value)
       Owner: Nobody
  Requestors: [email protected]
      Status: open
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=99607 >


Thanks for the reply, Steve.  I can see what you are saying.  I have C and some slight C++ experience from years ago.  It was just when OOP was starting to take off.  I'd be glad to try to get oriented enough that I could make a little contribution, but right now I'm a little disoriented in the syntax and protocol of the open-source contribution system not to mention the wxperl contribution system.  What file is the wxTextEntryDialog code in?  I can see the wxSingleChoiceDialog that you are speaking of.

----- Original Message -----
From: "Steve Cookson via RT" <[email protected]>
To: [email protected]
Sent: Tuesday, October 21, 2014 3:43:42 PM
Subject: Re: [rt.cpan.org #99607] Issue using wxTextEntryBox

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

Hi Patrick,

On 21-10-2014 17:06, Patrick via RT wrote:
>   When I create a wxSingleChoiceDialog, that does show up as a child.  Why is the handling of these two different?
Well, the implementation of the wxSingleChoiceDialog is much more 
complicated. You can look in wxPerl::XS. Here isTextEntryBox:

    wxTextEntryDialog::new( parent, message, caption =
    wxGetTextFromUserPromptStr, defaultValue = wxEmptyString, style =
    wxTextEntryDialogStyle, pos = wxDefaultPosition )
         wxWindow* parent
         wxString message
         wxString caption
         wxString defaultValue
         long style
         wxPoint pos


and here is wxSingleChoiceDialog:

    wxSingleChoiceDialog::new( parent, message, caption, chs, dt =
    &PL_sv_undef, style = wxCHOICEDLG_STYLE, pos = wxDefaultPosition )
         wxWindow* parent
         wxString message
         wxString caption
         SV* chs
         SV* dt
         long style
         wxPoint pos
       PREINIT:
         wxString* choices;
         SV** data;
         int n, n2;
       CODE:
         n = wxPli_av_2_stringarray( aTHX_ chs, &choices );
         if( !SvOK( dt ) )
         {
           RETVAL = new wxPliSingleChoiceDialog( parent, message,
    caption, n,
                 choices, 0, style, pos );
         }
         else
         {
           n2 = wxPli_av_2_svarray( aTHX_ dt, &data );
           if( n != n2 )
           {
             delete[] choices;
             delete[] data;
             choices = 0; data = 0; n = 0;
             croak( "supplied arrays of different size" );
           }
           RETVAL = new wxPliSingleChoiceDialog( parent, message,
    caption, n,
                 choices, data, style, pos );
           delete[] data;
         }
         delete[] choices;
       OUTPUT:
         RETVAL

wxSingleChoiceDialog has a whole new .cpp function 
(wxPliSingleChoiceDialog) written within wxPerl.  It also has a 
destructor there.  It is one of only 7 .cpps. It's not clear to me how 
the destructor it is called, but the two functions are implemented very 
differently.

It would be good to understand why they are different and bring them 
into line with each other.

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.