X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9f400412e4cf9572ac5e07066e098a61fe5dbdc8..d9fda37ba1e29443ed473d3c69e71480935e09b7:/src/gtk/listbox.cpp diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index d871800407..97530d7a49 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -846,7 +846,7 @@ void wxListBox::GtkSetSelection(int n, const bool select, const bool blockEvent) m_blockEvent = false; } -void wxListBox::DoSetFirstItem( int n ) +void wxListBox::DoScrollToCell(int n, float alignY, float alignX) { wxCHECK_RET( m_treeview, wxT("invalid listbox") ); wxCHECK_RET( IsValid(n), wxT("invalid index")); @@ -864,11 +864,21 @@ void wxListBox::DoSetFirstItem( int n ) // Scroll to the desired cell (0.0 == topleft alignment) gtk_tree_view_scroll_to_cell(m_treeview, path, NULL, - TRUE, 0.0f, 0.0f); + TRUE, alignY, alignX); gtk_tree_path_free(path); } +void wxListBox::DoSetFirstItem(int n) +{ + DoScrollToCell(n, 0, 0); +} + +void wxListBox::EnsureVisible(int n) +{ + DoScrollToCell(n, 0.5, 0); +} + // ---------------------------------------------------------------------------- // hittest // ----------------------------------------------------------------------------