Fix usage of wxWithImages::Images in wxTreebook

This commit is contained in:
Alexander Koshelev
2022-02-22 17:17:22 +01:00
committed by Vadim Zeitlin
parent c3b232dcfd
commit ca1eefdba2
2 changed files with 10 additions and 11 deletions

View File

@@ -564,16 +564,15 @@ wxWindow *wxTreebook::TryGetNonNullPage(size_t n)
return page;
}
void wxTreebook::SetImageList(wxImageList *imageList)
void wxTreebook::OnImagesChanged()
{
wxBookCtrlBase::SetImageList(imageList);
GetTreeCtrl()->SetImageList(imageList);
}
void wxTreebook::AssignImageList(wxImageList *imageList)
{
wxBookCtrlBase::AssignImageList(imageList);
GetTreeCtrl()->SetImageList(imageList);
// Propagate the images to the tree control which will actually use them.
wxTreeCtrl* const tree = GetTreeCtrl();
const Images& images = GetImages();
if ( !images.empty() )
tree->SetImages(images);
else
tree->SetImageList(GetImageList());
}
// ----------------------------------------------------------------------------