Jump to content
shineworld

Owner receives only Delphi objects

Recommended Posts

I need some help from Python + DelphiVCL guru.

Some time ago I've made a new DelphiVCL control to use VTK with Python + VCL + VTK.
To do that I've modified the Embarcadero's DelphiVCL package to add new control, called new library as cnc_vision_vcl

to not override already installad DelphiVCL library and all worked fine.

 

But I don't want to have a custom DelphiVCL and so I've tried to move the component in a delphivcl_ext project and

at now same code does not work.

What I've to in native Delphivcl code (which works)

  1. Create a clone of DelphiVCL projects as cnc_vision_vcl.
  2. Created new component WrapExtVTK.pas (attached).
  3. Modified source\vcl\WrapVclControls to import new unit:
    uses
      WrapDelphiTypes,
      WrapDelphiClasses,
      WrapDelphiWindows,
      WrapDelphiDataBind,
      WrapActions,
      WrapVclImgList,
      WrapVclControls,
      WrapVclGraphics,
      WrapVclForms,
      WrapVclActnList,
      WrapVclMenus,
      WrapVclStdCtrls,
      WrapVclComCtrls,
      WrapVclExtCtrls,
      WrapVclButtons,
      WrapVclGrids,
      WrapVclSamplesSpin,
      WrapVclWinXCtrls,
      WrapVclThemes,
      WrapVclDialogs,
      WrapVclMedia,
      WrapExtVTK;    // <--- new unit

     

  4. Compiled and used new cnc_vision_vcl.pyd file

  5. In the cnc_vision_vcl a zip with working test

     

All work fine but I want to move component in an "ext"tra package to leave untouched original delphivcl,
so I've created a clean project which add almost the same code but when I try to create the VTKPanel
object I obtains: 

self.vtk_panel = VTKPanel(self)
                     ^^^^^^^^^^^^^^
AttributeError: Owner receives only Delphi objects

In next chat the zip of entire project because I've reached post limits.



 

WrapExtVTK.pas

cnc_vision_vcl.zip

Share this post


Link to post
Posted (edited)

I don't this is going to work.  You are going to have duplicates of what is supposed  to be Singletons (WrapDelphi, PythonEngine).  It may work with run-time packages, but you would have to put all run-time packages in the same folder as the pyd files.

Edited by pyscripter

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×