View Issue Details

IDProjectCategoryView StatusLast Update
0035961LazarusLCLpublic2019-08-14 04:59
ReporterBlakeAssigned ToDmitry Boyarintsev 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionduplicate 
Product Version2.0.3 (SVN)Product Build61676 
Target VersionFixed in Version 
Summary0035961: (Cocoa) TListView.SetCount does not update the GUI
DescriptionTListView.SetCount only works if the TListView.HandleAllocated = false (ie when a window is being created, and not shown yet)
Steps To Reproduce1. (before form is shown) listview.Items.Count := 100

2. form.show or form.showmodal
100 items will be displayed in the GUI

3. listview.items.count := 200
still only 200 items will be displayed in the GUI
Additional InformationSuggested 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;
TagsNo tags attached.
Fixed in Revision
LazTarget-
WidgetsetCocoa
Attached Files

Relationships

duplicate of 0035957 closedDmitry Boyarintsev Cocoa: ListView with OwnerData not showing rows when added at run-time 

Activities

Blake

2019-08-14 01:15

reporter   ~0117664

Sorry, looks like this might be the same bug as https://bugs.freepascal.org/view.php?id=35957

Dmitry Boyarintsev

2019-08-14 03:48

developer   ~0117665

please close the issue, if the fix is confirmed

Blake

2019-08-14 04:59

reporter   ~0117667

Confirmed fixed with 61691, thanks!

Issue History

Date Modified Username Field Change
2019-08-14 01:10 Blake New Issue
2019-08-14 01:15 Blake Note Added: 0117664
2019-08-14 03:48 Dmitry Boyarintsev Assigned To => Dmitry Boyarintsev
2019-08-14 03:48 Dmitry Boyarintsev Status new => resolved
2019-08-14 03:48 Dmitry Boyarintsev Resolution open => duplicate
2019-08-14 03:48 Dmitry Boyarintsev LazTarget => -
2019-08-14 03:48 Dmitry Boyarintsev Widgetset Cocoa => Cocoa
2019-08-14 03:48 Dmitry Boyarintsev Note Added: 0117665
2019-08-14 03:51 Dmitry Boyarintsev Relationship added duplicate of 0035957
2019-08-14 04:59 Blake Status resolved => closed
2019-08-14 04:59 Blake Note Added: 0117667