From 8e19598f7fb35ba2aeed3d672d4c7c5cfed0cbf6 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Fri, 11 May 2012 06:28:54 +0000 Subject: [PATCH] fixes SetFirstItem, Thanks to David Wright git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71414 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/listbox_osx.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/osx/listbox_osx.cpp b/src/osx/listbox_osx.cpp index 982dad0705..a6e8b51418 100644 --- a/src/osx/listbox_osx.cpp +++ b/src/osx/listbox_osx.cpp @@ -133,6 +133,11 @@ void wxListBox::FreeData() void wxListBox::DoSetFirstItem(int n) { + // osx actually only has an implementation for ensuring the visibility of a row, it does so + // by scrolling the minimal amount necessary from the current scrolling position. + // in order to get the same behaviour I'd have to make sure first that the last line is visible, + // followed by a scrollRowToVisible for the desired line + GetListPeer()->ListScrollTo( GetCount()-1 ); GetListPeer()->ListScrollTo( n ); } -- 2.49.0