I have complained for years about the fact that the columns method does not work in a listbox under linux. In Windows it does.
It just so happens I have just found (together with a similar quirk nearby in the same .pas file) - more later - some strange behaviour.
I will present the code that I use for the two members of a submenu >>
procedure TChmenus.ActivesClick(Sender: TObject); // the second almost identical procedure is OtherClick(Send ...
var
i : smallint;
begin
ActFile := 0; // '1' in the OtherClick version
CurrPlayers.ListBox1.Clear;
CurrPlayers.caption := 'Active ' + MyCodes[integer(MyCode)] + ' Players : ' + inttostr(MaxRec[ActFile]); //
this is line A CurrPlayers.Show;
for i := 0 to MaxRec[ActFile]-1 do
CurrPlayers.ListBox1.Items.Add(KList[ActFile,i].name);
end;
Now, in linux these procedures seem to gum up (freeze) the program. So I have to use Ctrl-Alt-Esc to return to the IDE!
However, if I do a small shuffle of the spaces in only ONE of the two line A's shown, the program runs OK. Also OK if the second line A is edited also.
You can see (hopefully) how I have shifted some spaces >>
CurrPlayers.caption := 'Active' + ' ' + MyCodes[integer(MyCode)] + ' ' + 'Players : ' + inttostr(MaxRec[ActFile]);
I have moved the space after Active to a separate space to the right and the space before Players to before 'Players : '.
Note that if I change only ONE of the two procedures then the program runs OK. It doesn't matter which procedure.
I found a similar effect last year (12 Sept 2017), as follows.
Panel1.Caption := MyCodes[integer(MyCode)]; // this didn't work.
Inserting a space before MyCodes and one afterwards caused the program to work!!
Does anyone know what on earth is going on here? And am I making some coding mistake(s) - especially with using integer() ?
My Windows program works as desired except for colouring some buttons where it fails (a minor point). Linux won't behave with some bordericons (as I have complained previously about).
MikeFinch (and when is 'columns' going to work in linux?) >
PS >> "Proud As Punch" at the moment : I have managed to make an installer for the Windows version of my program (using Inno Setup script). I was forced into this because potential (Windows) users just cannot follow simple (to me) instructions re placing files in folders and subfolders.