[lazarus] a wierd crash in an apllication with StringGrid
Jesus Reyes
jesusrmx at yahoo.com.mx
Sun Dec 28 00:12:59 EST 2003
I will check it
regards.
Jesus Reyes A.
----- Original Message -----
From: LeVA <leva at az.isten.hu>
To: Lazarus list <lazarus at miraclec.com>
Sent: Saturday, December 27, 2003 3:31 PM
Subject: [lazarus] a wierd crash in an apllication with StringGrid
> Hi!
>
> I don't know if this is a bug, or not. I'll just explain what happened,
> and then it's up to you to decide it.
>
> I've put a StringGrid to my Form, and filled it up with data from a
> file. The StringGrid1.Scrollbars is set to 'SSAUTOVERTICAL', so if the
> data is "too much" a scrollbar will appear. I have a 'refresh' button on
> the same Form, and when I click on it, the data will be rereaded from
> the data file, and the StringGrid will be filled up with the new data.
> In the beginning this StringGrid has only two rows. One fixed (for the
> headers) and one empty (this is necesary if I have a fixed row). During
> the filling up, I'm increasing the RowCount after each row adding, so
> the RowCount-1 will be equal with the newly added rows.
> When I push that 'refresh' button, I want to reset the RowCount
> (otherwise I'll get a lot of empty rows). So, when I click the 'refresh'
> button, it's doing this:
> StringGrid1.RowCount := 2;
>
> And the filling comes after that.
>
> Now the StringGrid has filled, and the scrollbar has appeared, and I
> scrolled down until I saw the last element. If then I click the refresh
> button, my whole application crashes, and I get this error message in
> the console (it's because of the StringGrid1.RowCount := 2, not
> especialy of the 'refresh' button):
>
> TApplication.HandleException List index exceeds bounds (3)
> TApplication.HandleException: there was another exception during showing
> the first exception
> [TgtkObject.Destroy] WARNING: There are 1 unreleased DCs, a detailed
> dump follows:
> [TgtkObject.Destroy] DCs: 083C0494
> [TgtkObject.Destroy] WARNING: There are 3 unreleased GDIObjects, a
> detailed dump follows:
> [TgtkObject.Destroy] GDIOs: 08394734 08394794 08394A34
> [TgtkObject.Destroy] gdiBrush: 1
> [TgtkObject.Destroy] gdiFont: 1
> [TgtkObject.Destroy] gdiPen: 1
>
> So in the StringGrid if I scrolled down to the last element, and after I
> set the rowcount less than the existing rows, it crashes.
> Hope that this is understandable, I gathered my whole english knowledge
> to write this letter :) I know it could've been better.
> Please ask me if you don't understand what the problem is.
>
> ps.: I have changed my application, so it will only add new rows during
> the filling up if it is realy necesary, and I commented the Rowcount
> setting out, so it is working fine, but I think that it has to work in
> the other way too.
>
> Thanks!
>
> Daniel
>
>
> --
> LeVA
>
> _________________________________________________________________
> To unsubscribe: mail lazarus-request at miraclec.com with
> "unsubscribe" as the Subject
> archives at http://www.lazarus.freepascal.org/mailarchives
More information about the Lazarus
mailing list