Recent

Author Topic: Is it possible to use LCL widgets from a C program?  (Read 3666 times)

cruxic

  • Newbie
  • Posts: 2
Is it possible to use LCL widgets from a C program?
« on: July 09, 2013, 08:34:31 am »
Hello all,

I'm mostly new to Object Pascal but am very impressed by your extensive widgetset support (GTK, Qt, Windows, OSX etc).  How hard would it be to compile the essential components (eg window, button, checkbox, combobox, radio) into a shared library and call them from C code?  Would this be swimming against the current too much?  Is this the right place to ask such a question?

If you're curious about why I ask, you can read about my stdgui project: https://github.com/cruxic/stdgui

Much Thanks!
- Cruxic

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7508
Re: Is it possible to use LCL widgets from a C program?
« Reply #1 on: July 09, 2013, 11:02:56 am »
Well, first LCL is object oriented Pascal. So you would have to create a procedural C callable api in Pascal first.

Then you need to keep in mind that the widgetset is supported compiletime. So you would need a LCL shared lib per widgetset.

Finally, there are probably issues stuffing the LCL in a shared lib atm. (which is why Lazarus/FPC doesn't ship with everything in libs by default)
« Last Edit: July 09, 2013, 12:04:19 pm by marcov »

Leledumbo

  • Hero Member
  • *****
  • Posts: 8112
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Is it possible to use LCL widgets from a C program?
« Reply #2 on: July 09, 2013, 11:03:44 am »
Quote
How hard would it be to compile the essential components (eg window, button, checkbox, combobox, radio) into a shared library and call them from C code?  Would this be swimming against the current too much?  Is this the right place to ask such a question?
If anyone is patient enough, feel free to port the whole LCL. Currently, there's a LCL Bindings project that serves as a proof of concept (but never get any further for years).

cruxic

  • Newbie
  • Posts: 2
Re: Is it possible to use LCL widgets from a C program?
« Reply #3 on: July 09, 2013, 09:05:56 pm »
Thats kinda what I figured.  Thanks for the replies, folks.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: Is it possible to use LCL widgets from a C program?
« Reply #4 on: August 08, 2013, 12:29:22 pm »
It is possible, like lclbindings shows. And is not that hard, well not more than Qt bindings for Pascal for example.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8112
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Is it possible to use LCL widgets from a C program?
« Reply #5 on: August 08, 2013, 12:58:26 pm »
Quote
And is not that hard, well not more than Qt bindings for Pascal for example.
But it's hard to find someone who's willing to complete it ;)