Recent

Author Topic: is there any interest in fltk (Fast Light Toolkit)?  (Read 2730 times)

toby

  • Sr. Member
  • ****
  • Posts: 270
is there any interest in fltk (Fast Light Toolkit)?
« on: July 08, 2024, 07:43:30 pm »
Hi

is there any fpc fltk coding (Fast Light Toolkit)?
or is there any interest in it?
it is used in dillo browser (https://dillo-browser.github.io/)
https://www.fltk.org/ 
http://fltk.org/software.php

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11931
  • FPC developer.
Re: is there any interest in fltk (Fast Light Toolkit)?
« Reply #1 on: July 08, 2024, 10:45:21 pm »
is there any fpc fltk coding (Fast Light Toolkit)?

FPC had many bindings to minor widgetsets in the old days before Lazarus became usable. Most of those waned in popularity after that. But if you insist, a good google search might help.

toby

  • Sr. Member
  • ****
  • Posts: 270
Re: is there any interest in fltk (Fast Light Toolkit)?
« Reply #2 on: July 08, 2024, 10:56:06 pm »
yea i already searched excessively ^h^h extensively and came up with nothing for fpc and fltk

a fltk.pas unit would have to be made ... and i ain't smart enough to do it

i wanted to make a fpc based fltk plugin for dillo -

so i guess i will have to lean c or c++ to do it ....   of course not :)
relearning some german has filled up my remaining brain language capability center


Thaddy

  • Hero Member
  • *****
  • Posts: 16145
  • Censorship about opinions does not belong here.
Re: is there any interest in fltk (Fast Light Toolkit)?
« Reply #3 on: July 09, 2024, 09:24:35 am »
i wanted to make a fpc based fltk plugin for dillo -
That narrows it down considerably.
fltk has a good C interface, dunno about dillo, though.
Note that fltk has an even slower release cycle than fpc...
I wonder if it is worth the time, but if the plugin api is C, not C++, that should be not too difficult.
I was a fan of fltk many moons ago.

I mean it probably can be done, but should it be done?
« Last Edit: July 09, 2024, 09:29:18 am by Thaddy »
If I smell bad code it usually is bad code and that includes my own code.

Thaddy

  • Hero Member
  • *****
  • Posts: 16145
  • Censorship about opinions does not belong here.
Re: is there any interest in fltk (Fast Light Toolkit)?
« Reply #4 on: July 09, 2024, 09:44:11 am »
Then again, I will give it a try if you help me....If it can be done, why not?  8-)
If I smell bad code it usually is bad code and that includes my own code.

toby

  • Sr. Member
  • ****
  • Posts: 270
Re: is there any interest in fltk (Fast Light Toolkit)?
« Reply #5 on: July 09, 2024, 06:25:21 pm »
sure, i'd be glad to try to help

if we could get this to run in fpc - i think it would be a great first step


Code: C  [Select][+][-]
  1. /* Build with: g++ test.cpp -o test -lfltk */   // for fltk /tmp highlight bug
  2.  
  3. #include <cstdlib>
  4. #include <unistd.h>
  5.  
  6. #include <FL/Fl.H>
  7. #include <FL/Fl_Window.H>
  8. #include <FL/Fl_Button.H>
  9. #include <FL/Fl_File_Chooser.H>
  10.  
  11. void cb_file_select(Fl_Widget *o, void *v)
  12. {
  13.      char msg[256];
  14.      char *newfile = fl_file_chooser("Choose a file", NULL, NULL);
  15.  
  16.      if (newfile != NULL) {
  17.          sprintf(msg, "You choose %s", newfile);
  18.          fl_message(msg);
  19.      }
  20. }
  21.  
  22. int main (int argc, char ** argv)
  23. {
  24. //     chdir("/tmp");
  25. //     chdir("/html");
  26. //     Fl_Window *window = new Fl_Window(300, 300, 200, 200, "Foo");
  27.      Fl_Window *window = new Fl_Window(300, 300, 200, 200, "fltk.c++");
  28.  
  29.      Fl_Button *button = new Fl_Button(60, 40, 80, 40, "Select file");
  30.      button->callback(cb_file_select);
  31.      window->end();
  32.  
  33.      window->show(argc, argv);
  34.  
  35.      return(Fl::run());
  36. }
  37.  

a simple lib unit fltku.pas as first step?


marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11931
  • FPC developer.
Re: is there any interest in fltk (Fast Light Toolkit)?
« Reply #6 on: July 09, 2024, 09:49:05 pm »
\
Code: C  [Select][+][-]
  1. ...
  2.      Fl_Window *window = new Fl_Window(300, 300, 200, 200, "fltk.c++");
  3. ...
  4.  

a simple lib unit fltku.pas as first step?

That is not plain C but C++, and as Thaddy said that cannot be represented in FPC.

toby

  • Sr. Member
  • ****
  • Posts: 270
Re: is there any interest in fltk (Fast Light Toolkit)?
« Reply #7 on: July 09, 2024, 10:36:26 pm »


you astutely observered that this program is indeed written in c++

i gave that program as a simple fltk example program that i would like to have fpc duplicate functionally using the fltk c library

Thaddy did not say
'as Thaddy said that cannot be represented in FPC.'

didn't you write the CinFreePascal.pdf?
so what you are implying seems to me to contradict your section 4 in your pdf

in fact i have a fpc that runs c++ library code - it is called hello.c++ and i got it from your document




PascalDragon

  • Hero Member
  • *****
  • Posts: 5752
  • Compiler Developer
Re: is there any interest in fltk (Fast Light Toolkit)?
« Reply #8 on: July 09, 2024, 10:42:24 pm »
you astutely observered that this program is indeed written in c++

i gave that program as a simple fltk example program that i would like to have fpc duplicate functionally using the fltk c library

Thaddy did not say
'as Thaddy said that cannot be represented in FPC.'

didn't you write the CinFreePascal.pdf?
so what you are implying seems to me to contradict your section 4 in your pdf

in fact i have a fpc that runs c++ library code - it is called hello.c++ and i got it from your document

If you would have read CInFreePascal.pdf you'd know that you'd need to write wrapper code in C or C++ to provided flattened C code so that FPC can correctly import it.

toby

  • Sr. Member
  • ****
  • Posts: 270
Re: is there any interest in fltk (Fast Light Toolkit)?
« Reply #9 on: July 09, 2024, 11:42:28 pm »
not only did i read the pdf but i did all the coding in it - i know full well what was needed to 'wrap' c and c++ libraries and i even did the c libapl to work with fpc

didn't you bother reading that i did the hello.c++ code from the pdf?

toby

  • Sr. Member
  • ****
  • Posts: 270
Re: is there any interest in fltk (Fast Light Toolkit)?
« Reply #10 on: July 11, 2024, 01:26:20 am »
took about 6 1/2 hours but i finally got a fltk window to compile and run

marcov and pascaldragon - you migth want to examine how you view your excessive self importance and arrogance

and of course thaddy was a zip

PascalDragon

  • Hero Member
  • *****
  • Posts: 5752
  • Compiler Developer
Re: is there any interest in fltk (Fast Light Toolkit)?
« Reply #11 on: July 14, 2024, 09:57:43 pm »
didn't you bother reading that i did the hello.c++ code from the pdf?

Yes, I read it and you wrote:

in fact i have a fpc that runs c++ library code - it is called hello.c++ and i got it from your document

Nowhere does that say that you applied the teachings from that file to your usage of fltk.

roger T

  • New Member
  • *
  • Posts: 14
Re: is there any interest in fltk (Fast Light Toolkit)?
« Reply #12 on: July 15, 2024, 04:47:02 am »
for what it is worth I have used FLTK for a front-end to my project but have now rewritten it using lazarus-fp. It is by far a superior product (lazarus-fp that is)
and if your anything like me you would recognise C++ as an abomination.  :o

toby

  • Sr. Member
  • ****
  • Posts: 270
Re: is there any interest in fltk (Fast Light Toolkit)?
« Reply #13 on: July 16, 2024, 12:46:16 am »

the project uses fltk and c++ so stuck there but i agree with you fully about c++ *what a waste of time developing it*

could you post a link to the 'lazarus-fp' - i couldn't find anything about it?

I'm always intereted in new code to play^h^h work on :)

what did you do with your old fltk fpc code? i can do a very simple window (see above code that is now in fpc) but changing colors  on buttons is not in my grasp

PascalDragon

  • Hero Member
  • *****
  • Posts: 5752
  • Compiler Developer
Re: is there any interest in fltk (Fast Light Toolkit)?
« Reply #14 on: July 16, 2024, 09:10:52 pm »
could you post a link to the 'lazarus-fp' - i couldn't find anything about it?

I think roger T simply meant Lazarus/FPC and its LCL.

 

TinyPortal © 2005-2018