Recent

Author Topic: [SOLVED] TListView errors  (Read 2663 times)

apeoperaio

  • Full Member
  • ***
  • Posts: 158
[SOLVED] TListView errors
« on: September 26, 2018, 05:39:53 pm »
I am using lazarus trunk (Lazarus 2.1.0 r59168 FPC 3.0.4 x86_64-darwin-cocoa (alpha)).
I am not able to place a TListVIew on a form.
If I select a TListView from component palette and try to place it on a form I get "Error moving component ListView1: TListView"

I can create a TListView at runtime but I get "SIGABRT" if I add items to listview. And I get SIGSEGV on ItemFocused.MakeVisible(true);

See code below
Code: Pascal  [Select]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, StdCtrls;
  9.  
  10. type
  11.  
  12.   { TForm1 }
  13.  
  14.   TForm1 = class(TForm)
  15.     Button1: TButton;
  16.     procedure Button1Click(Sender: TObject);
  17.     procedure FormCreate(Sender: TObject);
  18.   private
  19.     _listview: TListView;
  20.   public
  21.  
  22.   end;
  23.  
  24. var
  25.   Form1: TForm1;
  26.  
  27. implementation
  28.  
  29. {$R *.lfm}
  30.  
  31. { TForm1 }
  32.  
  33. procedure TForm1.Button1Click(Sender: TObject);
  34. begin
  35.   _listview.Items.Add();
  36.   _listview.Items.Add();  // <<-- SIGABRT here
  37.   // it raise sigsegv  on the next line if previous line is commented
  38.   _listview.ItemFocused.MakeVisible(true);
  39. end;
  40.  
  41. procedure TForm1.FormCreate(Sender: TObject);
  42. begin
  43.   _listview:= TListView.Create(Self);
  44.   _listview.Align:= alClient;
  45.   _listview.Parent:= form1;
  46. end;
  47.  
  48. end.
  49.  

I don't know if this bug is present in lazarus rc 2.0
« Last Edit: October 10, 2018, 10:32:58 am by apeoperaio »

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2289
    • havefunsoft.com
Re: TListView errors
« Reply #1 on: October 01, 2018, 05:16:27 am »
try r59206
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

apeoperaio

  • Full Member
  • ***
  • Posts: 158
Re: TListView errors
« Reply #2 on: October 02, 2018, 01:31:46 pm »
The SIGABRT issue seems to be resolved when I add items at runtime.
Anyway I still get "Error moving component ListView1: TListView" when I try to place it on a form.

I tested using Lazarus 2.1.0 r59224 FPC 3.0.4 x86_64-darwin-cocoa (alpha)


apeoperaio

  • Full Member
  • ***
  • Posts: 158
Re: TListView errors
« Reply #3 on: October 04, 2018, 10:43:06 am »
I am a patron now!  :)

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2289
    • havefunsoft.com
Re: TListView errors
« Reply #4 on: October 05, 2018, 03:05:58 pm »
thank you!
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2289
    • havefunsoft.com
Re: TListView errors
« Reply #5 on: October 09, 2018, 05:05:20 am »
r59273 should fix the issue.
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

apeoperaio

  • Full Member
  • ***
  • Posts: 158
Re: TListView errors
« Reply #6 on: October 10, 2018, 09:55:59 am »
r59273 should fix the issue.

It works.
Thank you!