Recent

Author Topic: Embedding an interactive terminal in the Lazarus IDE  (Read 1488 times)

sysrpl

  • Sr. Member
  • ****
  • Posts: 315
    • Get Lazarus
Embedding an interactive terminal in the Lazarus IDE
« on: April 10, 2018, 11:17:51 pm »
It looks like adding a terminal window to any Gtk 2/3 application isn't that difficult if you use a library called libvte.

I am considering writing an IDE package to do this, but wanted to know if anyone knows if this has been done before, and if the libvte functions already have a pascal declaration, or maybe an LCL compatible exampl somewhere.

Here is a brief overview:

https://cache.getlazarus.org/videos/libvte-question.mp4

After a short attempt I got some stuff done. I'm able to create a fully working terminal application using fpc, but when I try to incorporate it into a TWinControl there are some problems:

https://cache.getlazarus.org/videos/vte-control.mp4

Notably, I believe the LCL gtk2 widgetset makes some core assumptions about the internal memory layout of any PGtkWidget that do not apply to a PVteTerminal. This is causing access violations when it interacts with the LCL as the LCL tries to access structures and that do not exists.

Here is the code for the TTerminal control (designed to work only on gtk2). Maybe someone could recommend a fix?

https://pastebin.com/y8wFvKsg

A code archive for both projects here:

http://cache.getlazarus.org/archives/simterm.7z

 

TinyPortal © 2005-2018