LCL with fpGUI on Linux lazarus / 31-LCL ---------------------------------------------------------------------- rsz · 2019-06-19 15:17 Hi. I'm trying to get LCL with fpGUI working on Linux (Ubuntu 19.04) but I have run into an issue that I don't know how to solve. I followed the guide over at: https://wiki.lazarus.freepascal.org/fpGUI_Interface#Creating_your_firs t_LCL_application_with_fpGUI I have selected option 2 (symlinking) at step 4.1 and did the following: Code: [Select]cd /usr/lib/lazarus/default/lcl/interfaces/fpgui sudo ln -s /home/rsz/fpgui/src src I then created an application project in Lazarus and added IDE macros: LCLWidgetType:=fpgui and fpGUIPlatform:=x11 Unfortunately I get the following error message when I build it: Code: [Select]project1.lpr(9,3) Fatal: Cannot find Interfaces used by project1. Enable flag "Use Unit" of unit Interfaces in package LCL. Any ideas? ---------------------------------------------------------------------- Thaddy · 2019-06-19 15:45 yes. LCL is a framework and FPGui is a different framework. Don't mix them..... BASIC Although both frameworks supports all of the FPC packages available for a flatform. (So not Lazarus!!!!! only Lazarus supports LCL) ---------------------------------------------------------------------- marcov · 2019-06-19 15:53 Thaddy, there is a "fpgui" backend for LCL. Just like GTK. rsz: ignore Thaddy, what is wrong I don't know, but make sure you set the lcl backend over the GUI controls. Otherwise you risk that Lazarus adds the same macros as you do too. Things to check: - disable message filters, increase verbosity and try to find out what exactly goes wrong. - see if you can see the commandline somewhere, to check if multiple lcl types are passed. ---------------------------------------------------------------------- Thaddy · 2019-06-19 15:57 I did not know there was an fpgui back-end, but stll you can not mix the two, Marco...... You can not use LCL controls in an fpgui application. Period. Same with KOL.. I think that's where the confusion is about, I may be wrong...(I don't think so....) ---------------------------------------------------------------------- rsz · 2019-06-19 18:55 I'm still not sure why the initial error (interface not found) message occurs with Lazarus installed through apt, but I have tried compiling Lazarus from source and have gotten a bit further. It now no longer complains that it can't find the fpGUI interface, but it now complains about the fpGUI code itself. It seems to be missing the 'Graph' Unit. Just out of curiosity I removed Graph from the source file and the compilation got further and I found the following afterwards that also mentions removing Graph: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-fpGUI-WS- update-td4053988.html It's now stuck on: Code: [Select]fpguiwsbuttons.pp(88,60) Error: Wrong number of parameters specified for call to "GetImageIndexAndEffect"in the following procedure (line 15): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i class procedure TFpGuiWSBitBtn.SetGlyph(const ABitBtn: TCustomBitBtn;  const AValue: TButtonGlyph);var  lButton: TFPGUIPrivateButton;  lBitmap: TBitmap=nil;  fpgImage: TfpgImage;  lButImageName: string;  lButtonState: TButtonState;  lIndex: integer;  lEffect: TGraphicsDrawEffect;begin  if not Assigned(AValue.Images) then exit;  lButton := TFPGUIPrivateButton(ABitBtn.Handle);  lButtonState:=bsUp;  Value.GetImageIndexAndEffect(lButtonState,lIndex,lEffect)  lBitmap:=TBitmap.Create;  AValue.Images.GetBitmap(lIndex,lBitmap);  fpgImage:=TfpgImage.Create;   fpgImage.AllocateImage(32,lBitmap.Width,lBitmap.Height);  move(lBitmap .RawImage.Data^,fpgImage.ImageData^,fpgImage.ImageDataSize);   fpgImage.CreateMaskFromSample(0,0);  fpgImage.UpdateImage;  lBitmap.Free;  if lButton.Button.ImageName<>'' then begin    fpgImages.DeleteImage(lButton.Button.ImageName,true);  end;  lButImageName:='lcl.bitbtn.'+IntToStr(PtrInt(ABitBtn.Handle));  fpgImages.AddImage(lButImageName,fpgImage);  lButton.Button.ImageName:=lButImageName;  lButton.Button.ShowImage:=true;end; Is it possible that the fpGUI isn't updated to work with the latest LCL version? or what is the status of fpGUI as LCL backend? Quote from: Thaddy on June 19, 2019, 05:57:51 pmI did not know there was an fpgui back-end, but stll you can not mix the two, Marco...... You can not use LCL controls in an fpgui application. Period. Same with KOL.. I think that's where the confusion is about, I may be wrong...(I don't think so....) I am not trying to use LCL controls in an fpGUI application and neither am I trying to use fpGUI controls in an LCL application. I'm trying to use pure LCL and change the backend to be fpGUI, just like you can change the backend to be Qt instead of Gtk+ on Linux. I believe "interface" (as opposed to backend) is the proper terminology for it, but I'm new to Lazarus. There also is an option to select fpGUI as LCLWidgetType in Lazarus, so I assume it must be possible. ---------------------------------------------------------------------- Zoran · 2019-06-19 20:31 The LCL-fpGUI interface started many years ago, but never got very far. See here: https://wiki.lazarus.freepascal.org/Roadmap#Widgetset_depend ent_components When I started using Lazarus, ten years ago, its state looked pretty much same. So, it seems abandoned. See this post from Graeme, five years ago: https://forum.lazarus.freep ascal.org/index.php/topic,25530.msg155422.html#msg155422 (the controls from the Standard tab of Component palette work, except TLabel) -- so, its far from usable for a serious application. I don't think that things changed since then. On the other hand, fpGui itself, used without LCL, is fully working. It seems that Graeme was never interested in LCL-fpGUI development, (see also the bottom of this post: https://forum.lazarus.freepascal.or g/index.php/topic,31971.msg205651.html#msg205651). After LCL-fpGui, there was another effort to make pure Pascal (independent of external GUI libraries) LCL backend -- it was Custom Drawn Interface, but, after a while, it also looks abandoned. So, either go for fpGui, as a standalone GUI library (without LCL), or choose LCL with "native" OS widgetsets. Or... take the third way, you take over LCL-fpGui development and bring it to life! ---------------------------------------------------------------------- rsz · 2019-06-19 22:10 Ah it's unfortunate that fpGUI and the custom drawn interface have never been finished. I was mainly interested in fpGUI due to it using X11 directly and therefore being a lot more lightweight than Gtk+ or Qt. Using a more lightweight backend would be very advantageous on RAM constrained systems. LCL is pretty awesome and I wouldn't want to use fpGUI directly, as I then am unable to compile using the other LCL backends (present and future). Quote from: Zoran on June 19, 2019, 10:31:49 pmOr... take the third way, you take over LCL-fpGui development and bring it to life! If I decide to write my future programs using Lazarus then I would be inclined to do so (fpGUI or Custom Drawn Interface), as my only other option would be writing my own memory efficient toolkit . ---------------------------------------------------------------------- JuhaManninen · 2019-06-20 06:17 Quote from: Zoran on June 19, 2019, 10:31:49 pmWhen I started using Lazarus, ten years ago, its state looked pretty much same. So, it seems abandoned. See this post from Graeme, five years ago: https://forum.lazarus.freep ascal.org/index.php/topic,25530.msg155422.html#msg155422 (the controls from the Standard tab of Component palette work, except TLabel) -- so, its far from usable for a serious application. I don't think that things changed since then. In fact it was improved just last month in revisions 61119 - 61128. Patches came from Graeme himself. It means users of LCL-fpGUI should use Lazarus trunk (development version). QuoteOr... take the third way, you take over LCL-fpGui development and bring it to life! +1 Good idea.