Hi,

On 19/03/2011 11:37, Mattia Barbon wrote:

If I read the code correctly, forcevirtual is always false; is it there
just in case or is there a real need for it in current code?

Just in case. Knowing that we have some virtual callbacks in classes that don't have a wxPl prefix - it seemed the right thing to do that you could add

wxPli_create_virtual_evthandler( aTHX_ RETVAL, CLASS, true);
to the XS code if you wished and use a O_WXEVTHANDLER typemap.

For example, in the current XS code for wxScrolledWindow, the default constructor uses wxPli_create_evthandler, but the full constructor does not. It would be nice to have wxPli_create_virtual_evthandler( aTHX_ RETVAL, CLASS, true) in both and change typemap to O_WXEVTHANDLER

It also seemed desirable to at least provide the necessary bit in the code I'm looking at now so that you could in the future make something like the following work if you wished (note - if it didn't work as is, I'm not suggesting it is really worth the effort) and move all classes into the 'interface' tree gradually.

%NoVirtualBase;
%VirtualImplementation{
        %Name{wxScrolledWindow};
%Declaration{% WXPLI_DECLARE_DYNAMIC_CLASS( wxPliScrolledWindow ); %}; %Implementation{% WXPLI_IMPLEMENT_DYNAMIC_CLASS( wxPliScrolledWindow , wxScrolledWindow); %};
    };

%name{newDefault} wxScrolledWindow() %Overload
%postcall{% wxPli_create_virtual_evthandler( aTHX_ RETVAL, CLASS, true ); %};

For binary compatibility, functions must be added at the end of struct
wxPliHelpers.

Ahh - I had to rebuild Wx::TreeListCtrl etc - now I understand why.

Please fix indentation to use spaces before applying! :-)

Indeed, I'll fix my evil text editor settings.

Thanks for your help.

Mark

Reply via email to