From b939c391670d1327defbd89a5668a0ae4497d337 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Wed, 7 Aug 2013 19:42:52 -0400 Subject: [PATCH] Tracker: Fix #8388. BNavigator shouldn't update its location until AllAttached(). Otherwise, it might immediately trigger a redraw, and in such a case, the navigation buttons wouldn't yet have had a chance to load their icon resources, leading to a debug assert in BPictureButton due to said images not being present, but required. --- src/kits/tracker/Navigator.cpp | 11 ++++++++--- src/kits/tracker/Navigator.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/kits/tracker/Navigator.cpp b/src/kits/tracker/Navigator.cpp index 9f29594587..3d0ef5cbdf 100644 --- a/src/kits/tracker/Navigator.cpp +++ b/src/kits/tracker/Navigator.cpp @@ -179,9 +179,6 @@ BNavigator::~BNavigator() void BNavigator::AttachedToWindow() { - // Inital setup of widget states - UpdateLocation(0, kActionSet); - // All messages should arrive here fBack->SetTarget(this); fForw->SetTarget(this); @@ -190,6 +187,14 @@ BNavigator::AttachedToWindow() } +void +BNavigator::AllAttached() +{ + // Inital setup of widget states + UpdateLocation(0, kActionSet); +} + + void BNavigator::Draw(BRect) { diff --git a/src/kits/tracker/Navigator.h b/src/kits/tracker/Navigator.h index 56fe2d42d7..d290a2f8d8 100644 --- a/src/kits/tracker/Navigator.h +++ b/src/kits/tracker/Navigator.h @@ -98,6 +98,7 @@ protected: virtual void Draw(BRect rect); virtual void MessageReceived(BMessage* msg); virtual void AttachedToWindow(); + virtual void AllAttached(); void GoForward(bool option); // is option key held down? void GoBackward(bool option);