Recent

Author Topic: Bug if FileListBox.Sorted in the Object Inspector  (Read 1131 times)

hannaconner

  • Newbie
  • Posts: 1
Bug if FileListBox.Sorted in the Object Inspector
« on: July 14, 2025, 11:19:17 am »
Linux Debian 12.9 Gtk2.24 Lazarus 3.8 FreePascal 3.2.2

Thaddy

  • Hero Member
  • *****
  • Posts: 19147
  • Glad to be alive.
Re: Bug if FileListBox.Sorted in the Object Inspector
« Reply #1 on: July 14, 2025, 03:26:52 pm »
You have to set the sorted property before you populate the listbox with items.
That's on all platforms.
Alternatively call listbox.sort in the formcreate.
The problem is, that setting the sorted property when the listbox already contains many items is not really smart.
(It would invoke a sorting action, which can be slow and unresponsive)
Adding is no problem, nor is sorting afterwards.
« Last Edit: July 14, 2025, 03:30:26 pm by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

 

TinyPortal © 2005-2018