Lazarus/Free Pascal

I use to install Lazarus/Free Pascal on each of the Linux distributions that I try out. On NixOS 22.11 Lazarus 2.2.2 installs with the only little problem that the Fppkg configuration isn’t correct (a problem that I encountered with several other distributions). Building GUI applications also works without any problems.

However, a very bizarre behaviour (I never have seen something like that before) of the application when you run it. If you fill in the form’s edit fields and then click in such a field, the field content “disappears”. It also happens that if the program writes in some filed, the content of one or more other fields “disappears” (randomly?). This “disappearance” does not mean that the field is cleared. In one of my apps, where a configuration data form emits an error message if there is a blank field, the data is correctly saved even if there are fields that I had filled in, but the content of which has “disappeared” later. In some sense, it seems as if the field content becomes invisible depending on fill-in of other fields or mouse-clicks in a field, what isn’t possible, I guess…

Is there anyone who experienced similar problems with Lazarus or other applications? Any suggestions how this could be fixed? Thanks in advance.

1 Like

greetings !
I haven’t used pascal lazarus for a while, but I would like to help.

Could you provide some steps to reproduce, eg sample project, maybe record video of steps to reproduce

Is this only for applications you build yourself or also applications in nixpkgs?

Hi again. Thanks that you want to try to help me. Here some of the observations that I made. For the rest, just try yourself, clicking here and there… The whole seems more like magic than discovering whatever logical behavior in that!

Download links of the sources of 2 of my apps:

My observations:

  1. NixOS applications seem to work correctly.
  2. The Lazarus IDE itself has the issue: Just choose “Options” and click in one of the edit fields: all or some fields’ content disappears and some come back if you click in another field.
  3. My BlackJack2 application:
  • starts up with empty name fields (they are actually filled with default values); however, sometimes one of the field contains this value;
  • if both fields are empty and you click in the Player 1 field and then in the Player 2 field, the content of the Player 1 field shows up. If you click again in the Player1 field, its content disappears, the one of Player 2 showing up. Clicking in some other field, the content of the Player 1 field also shows up;
  • if the app starts with both fields empty, hitting the “Deal” button makes show them up;
  • entering the Stake value makes disappear it immediately. Clicking in the field shows it, but just for a sec. If you push the “Hit” button, the Stake value shows up and stays.