# Restoring the C++Builder visual component from VTK 7 and 8

**URL:** https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053
**Category:** Development
**Tags:** proposal
**Created:** [December 20, 2024, 11:29am UTC](https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053 "2024-12-20T11:29:42Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![davidmillington](https://discourse.vtk.org/user_avatar/discourse.vtk.org/davidmillington/32/9643_2.png) [@davidmillington](https://discourse.vtk.org/u/davidmillington)
#### Post date: [December 20, 2024, 11:29am UTC](https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053/1 "2024-12-20T11:29:42Z")

</div>

Hello. VTK versions 7 and 8 shipped with a visual component/widget for C++Builder (eg: VTK-7.1.1\Examples\GUI\Win32\vtkBorland\Package). This is not present in VTK 9.

Is it possible to restore this please?

I filed an [issue request](https://gitlab.kitware.com/vtk/vtk/-/issues/19565) but it was closed with a comment about CMake. C++Builder supports CMake, including for component packages. We are currently trying to [contribute toolchain support back to CMake itself](https://gitlab.kitware.com/lee.cantey/cmake/-/commit/7dbd6bd8099cc796e5e45f322d4330c70d39ba23).

I would simply make a pull request myself – we’ve had several bug reports filed by customers about this – but it takes time to get approval to contribute to external code bases ☹ I apologise for that. I can absolutely help in any way short of directly making a pull request with code I write until I get that approval. FWIW, the existing component from v8 should work unless VTK itself has made API changes. On the CB side we are 100% backwards compatible in this area.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [December 20, 2024, 2:55pm UTC](https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053/2 "2024-12-20T14:55:13Z")

</div>

The VTK CMake API changed, but it probably shouldn’t be too hard to port the relevant bits from the example. The examples themselves have changed a bit too. I don’t think anyone here has access to test any such support here, but if you’d like to submit an MR with support that works as you need, I think that would be acceptable.

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [December 20, 2024, 3:25pm UTC](https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053/3 "2024-12-20T15:25:05Z")

</div>

Just an FYI for anyone reading this, here is a link to the code:

[https://gitlab.kitware.com/vtk/vtk/-/tree/v8.2.0/Examples/GUI/Win32/vtkBorland?ref\_type=tags](https://gitlab.kitware.com/vtk/vtk/-/tree/v8.2.0/Examples/GUI/Win32/vtkBorland?ref_type=tags)

Even though it was included with VTK 7 and 8, my understanding is that it has been unmaintained since VTK 5.

---

<div class="post-metadata">

### Author: ![oliwe](https://discourse.vtk.org/user_avatar/discourse.vtk.org/oliwe/32/6469_2.png) [@oliwe](https://discourse.vtk.org/u/oliwe)
#### Post date: [January 2, 2025, 12:54pm UTC](https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053/4 "2025-01-02T12:54:34Z")

</div>

Yes - it has not been maintained since VTK 5.  
But it was still usable.  
I use VTK 7.1.1 with C++ Builder 11.3 and with the current version 12.2.  
The current C++Builder version is CMake compatible again.  
The current VTK can be build with it.  
It shouldn’t be too difficult to re-include the code for the visual component/widget.

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [January 2, 2025, 4:26pm UTC](https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053/5 "2025-01-02T16:26:14Z")

</div>

The README and other files (.bpk, .bpr) would need to be updated, because library names and contents have changed since VTK 5. And references to “Borland” changed to “Embarcadero”. Plus testing to demonstrate that it actually works with VTK 9.4. None of that is difficult, but it would still take time (several hours at least) and access to a C++Builder environment.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [January 3, 2025, 9:17am UTC](https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053/6 "2025-01-03T09:17:40Z")

</div>

​This is a nice project, but I do not think it should be inside of VTK. Such a project deserve its own repository with maintainers dedicated to keep it working and its own CI.

---

<div class="post-metadata">

### Author: ![oliwe](https://discourse.vtk.org/user_avatar/discourse.vtk.org/oliwe/32/6469_2.png) [@oliwe](https://discourse.vtk.org/u/oliwe)
#### Post date: [February 12, 2025, 11:50am UTC](https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053/7 "2025-02-12T11:50:14Z")

</div>

I have now compiled and linked the old Borland VTK 5 component against VTK 9.3.

BTW perhaps “Borland” should be replaced with “VCL” instead of “Embarcadero”. I will determine this with others. Any suggestions?

That has worked so far.  
The component can be installed and used in a C++Builder Win64x application.  
There is still a problem at the moment, probably with the initialization.

I use these lines:

```auto
#include <vtkAutoInit.h>
VTK_MODULE_INIT(vtkRenderingOpenGL2);
VTK_MODULE_INIT(vtkInteractionStyle);
VTK_MODULE_INIT(vtkRenderingFreeType);

```

They were enough for the component to work with VTK 7.1.

Now the call

```auto
vtkVCLRenderWindow->GetRenderWindow();

```

fails and works on the second call.  
After the second call I can use `GetRenderWindow()` or `GetRenderer()` without any problems.  
Also this works:

```auto
Renderer1 = vtkVCLRenderWindow->GetRenderer();
Renderer1->SetBackground(rgb);

```

If anyone has any ideas, I would be grateful.  
At the moment I think something is not initialized.  
I have to try to debug this.

Nevertheless I will now try to build a larger project using VTK extensively with the new compiler bcc64x and VTK 9.3. More on that soon.

---

<div class="post-metadata">

### Author: ![oliwe](https://discourse.vtk.org/user_avatar/discourse.vtk.org/oliwe/32/6469_2.png) [@oliwe](https://discourse.vtk.org/u/oliwe)
#### Post date: [February 24, 2025, 3:13pm UTC](https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053/8 "2025-02-24T15:13:54Z")

</div>

My dirty workaround for the initialization problem is:

```auto
try{
   vtkVCLRenderWindow->GetRenderWindow();
}
catch(...){
   bool go_on = true;
}

```

The component seems to work with VTK 9.3 as before with VTK 7.1 🙂  
I’ll report back as soon as I have clean code.

---

<div class="post-metadata">

### Author: ![gzgius](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/g/eb8c5e/32.png) [@gzgius](https://discourse.vtk.org/u/gzgius)
#### Post date: [February 27, 2025, 3:15pm UTC](https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053/9 "2025-02-27T15:15:17Z")

</div>

Hi,  
did you shared this component? I am interested on it

---

<div class="post-metadata">

### Author: ![oliwe](https://discourse.vtk.org/user_avatar/discourse.vtk.org/oliwe/32/6469_2.png) [@oliwe](https://discourse.vtk.org/u/oliwe)
#### Post date: [March 1, 2025, 2:59pm UTC](https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053/10 "2025-03-01T14:59:05Z")

</div>

This component will be shared somehow in the coming weeks.

---

<div class="post-metadata">

### Author: ![gzgius](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/g/eb8c5e/32.png) [@gzgius](https://discourse.vtk.org/u/gzgius)
#### Post date: [March 4, 2025, 7:15am UTC](https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053/12 "2025-03-04T07:15:23Z")

</div>

Thank you Oliwe!

---

<div class="post-metadata">

### Author: ![oliwe](https://discourse.vtk.org/user_avatar/discourse.vtk.org/oliwe/32/6469_2.png) [@oliwe](https://discourse.vtk.org/u/oliwe)
#### Post date: [July 14, 2025, 9:36am UTC](https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053/13 "2025-07-14T09:36:40Z")

</div>

[VTKPackageRenderer.7z](https://discourse.vtk.org/uploads/short-url/9nZfQ2Rl3llbMltMSRXXWqNq01D.7z) (9.8 KB)  
[readme.txt](https://discourse.vtk.org/uploads/short-url/iSGhbsqASv9Ve9X1xKOXRrEo8dZ.txt) (1.2 KB)

Revival of the old VTK rendering component that was available up to VTK 8 and is missing from VTK 9 onwards.

It would be nice if this could be integrated into VTK again!

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [July 21, 2025, 12:20pm UTC](https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053/14 "2025-07-21T12:20:26Z")

</div>

Please feel free to submit an MR adding it back.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [July 21, 2025, 1:04pm UTC](https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053/15 "2025-07-21T13:04:36Z")

</div>

Ah, I see; it’s more than an example. With VTK’s new module system providing a standalone package for `vtkVCLRenderWindow` should be far more possible.

---

<div class="post-metadata">

### Author: ![oliwe](https://discourse.vtk.org/user_avatar/discourse.vtk.org/oliwe/32/6469_2.png) [@oliwe](https://discourse.vtk.org/u/oliwe)
#### Post date: [July 21, 2025, 1:16pm UTC](https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053/16 "2025-07-21T13:16:07Z")

</div>

> [@ben.boeckel](#):
>
> `vtkVCLRenderWindow`

So, what are the next steps I should take? vtkVCLRenderWindow is a component that can be used via drag and drop in the RAD Studio IDE.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [July 21, 2025, 1:38pm UTC](https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053/17 "2025-07-21T13:38:37Z")

</div>

Maybe I’m missing context for what this is doing (I’ve never used C++Builder myself). Is it proposed that `vtkVCLRenderWindow` be shipped with VTK itself or is it part of an example? Or is it more like an IDE plugin that VTK would ship (in the vein of the QtDesigner plugin I think we used to ship to make it aware of `QVTKWidget` beyond “custom widget”)?

---

<div class="post-metadata">

### Author: ![oliwe](https://discourse.vtk.org/user_avatar/discourse.vtk.org/oliwe/32/6469_2.png) [@oliwe](https://discourse.vtk.org/u/oliwe)
#### Post date: [July 21, 2025, 2:08pm UTC](https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053/18 "2025-07-21T14:08:12Z")

</div>

Older VTK versions (up to and including version 8) included the code for a visual component that could be used in C++Builder. The code was always located here:  
vtk\VTK5.10.1\Examples\GUI\Win32\vtkBorland  
However, the Borland compiler (bcc23, bcc64) eventually became unable to build VTK – but with the current compiler (bcc64x), it works again.  
I personally use the component in the current C++Builder 12.3. It would be very convenient if the component could be added back to the VTK repository.  
I renamed the component because Borland no longer exists in this sense, and VCL is the name of the GUI framework (corresponding to Qt) used in C++Builder.  
Maybe \GUISupport is a better location for vtkVCLRenderWindow?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [July 21, 2025, 5:12pm UTC](https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053/19 "2025-07-21T17:12:10Z")

</div>

> [@oliwe](#):
>
> Maybe \GUISupport is a better location for vtkVCLRenderWindow?

Is this a class intended to be used by VTK API consumers? Or is purely in service of this IDE-like plugin (if I’ve understood correctly)?

---

<div class="post-metadata">

### Author: ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)
#### Post date: [July 22, 2025, 12:27am UTC](https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053/20 "2025-07-22T00:27:26Z")

</div>

The visual component library, VCL, is a set of gui components developed by Borland for Delphi and C++ Builder (originally Windows desktop) applications.

Compiling VTK using C++ Builder emits objects that can be linked into BPLs (Borland package library) and used in other C++ Builder projects where standard C++ compiler output cannot.

---

<div class="post-metadata">

### Author: ![oliwe](https://discourse.vtk.org/user_avatar/discourse.vtk.org/oliwe/32/6469_2.png) [@oliwe](https://discourse.vtk.org/u/oliwe)
#### Post date: [August 20, 2025, 1:28pm UTC](https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053/21 "2025-08-20T13:28:33Z")

</div>

[VTKPackageRenderer.7z](https://discourse.vtk.org/uploads/short-url/tXfLNRu6VIG9RTuIXWpLNXiptlJ.7z) (10.3 KB)  
[readme.txt](https://discourse.vtk.org/uploads/short-url/63GqHdrnlTBIJmionJoSGcFzhHr.txt) (1.2 KB)

Minor code changes.

[Next page](https://discourse.vtk.org/t/restoring-the-c-builder-visual-component-from-vtk-7-and-8/15053.md?page=2)
