(Cocoa) TListView.SetCount does not update the GUI
Original Reporter info from Mantis: Blake
-
Reporter name: Blake
Original Reporter info from Mantis: Blake
- Reporter name: Blake
Description:
TListView.SetCount only works if the TListView.HandleAllocated = false (ie when a window is being created, and not shown yet)
Steps to reproduce:
-
(before form is shown) listview.Items.Count := 100
-
form.show or form.showmodal
100 items will be displayed in the GUI -
listview.items.count := 200
still only 200 items will be displayed in the GUI
Additional information:
Suggested fix in CocoaWSComCtrls.pas - this class procedure is not overridden yet:
class procedure TCocoaWSCustomListView.SetItemsCount(const ALV: TCustomListView; const Avalue: Integer);
var
theNSTableView: NSTableView;
begin
if (ALV <> nil) and (ALV.HandleAllocated) then
begin
if (TCocoaScrollView(ALV.Handle) <> nil) then
begin
if (TCocoaScrollView(ALV.Handle).contentView <> nil) then
begin
if (NSClipView(TCocoaScrollView(ALV.Handle).contentView).documentView <> nil) then
theNSTableView := NSTableView(NSClipView(TCocoaScrollView(ALV.Handle).contentView).documentView);
theNSTableView.noteNumberOfRowsChanged;
end;
end;
end;
end;
Mantis conversion info:
- Mantis ID: 35961
- Build: 61676
- Version: 2.0.3 (SVN)
- Monitored by: » Blake (Blake)