Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-07

TListView.TopItem and TListView.GetItemAt()

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bernd

I am trying to get the Item that is currently visible at the top of the list. The reason why I need this is after inserting new items which unfortunately seems to always reset the scrolling I want to make the list scroll to a position so that this item is visible again, using MakeVisible().

I have experimented with TopItem and GetItemAt() but no matter what I do and to where the list is scrolled I cannot get anything else but nil from these functions.

I am currently on Linux, GTK2, very recent snapshot, I have not tried windows yet. Are these functions not implemented yet or might there be anything that I have missed, maybe some property or style of the listview must be turned on or off for this to work?

Is there any other cross platform way to get and set the scroll position or make the list stop scrolling to the top whenever a new item is inserted or added?

Bernd

Reply by email

Bernd
to Unknown author

Seems like I cannot leave them away. The list will be completely messed up (columns not matching each other anymore) after inserting an item at index 0. The only way to fix this seems to be BeginUpdate EndUpdate or scrolling to the 0th element in the list.

Now I am back to square one. Is there *any* way to get/set the scroll position of the list? I cannot imagine that something so simple is not possible somehow. All I want to achieve is to insert one item into the list without completely resetting the scroll position.

Reply by email