Author: stippi Date: 2010-06-10 10:52:57 +0200 (Thu, 10 Jun 2010) New Revision: 37077 Changeset: http://dev.haiku-os.org/changeset/37077/haiku Modified: haiku/trunk/src/apps/launchbox/PadView.cpp Log: Adding a button at a specific position did not work since converting LaunchBox to using layout management. When storing the settings, the new button was stored last. Using the BLayoutItem at the given index retrieves the correct button. Modified: haiku/trunk/src/apps/launchbox/PadView.cpp =================================================================== --- haiku/trunk/src/apps/launchbox/PadView.cpp 2010-06-09 21:31:00 UTC (rev 37076) +++ haiku/trunk/src/apps/launchbox/PadView.cpp 2010-06-10 08:52:57 UTC (rev 37077) @@ -297,7 +297,10 @@ LaunchButton* PadView::ButtonAt(int32 index) const { - return dynamic_cast<LaunchButton*>(ChildAt(index)); + BLayoutItem* item = fButtonLayout->ItemAt(index); + if (item == NULL) + return NULL; + return dynamic_cast<LaunchButton*>(item->View()); }