Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

CPTabView removeTabViewItem: fails to remove tab [patch included]

#288

Browser: Safari 4 (untested in others)
Symptom: Calling removeTabViewItem: on a CPTabView causes the associated tab view item to be removed from its list, but does not remove the graphical label (_CPTabViewLabel) associated with it.

Cause: CPTabView uses a CPTabLabelsView class which manages the graphical tabs. It is a delegate to the CPTabView, and receives a tabView:didRemoveTabViewItem: message when the CPTabView removes a tab view item. It calls indexOfTabViewItem: on the CPTabView to determine which of its CPTabLabels to remove from the superview. However, this delegate method is called after the CPTabViewItem has been removed, so the _CPTabLabelsView delegate will always fail to find the index when indexOfTabViewItem: is called. As such, the CPTabLabel is never removed from its superview.

Solution: patch attached, however by moving the delegate call to happen before the removal of the CPTabViewItem from the CPTabView's list, the name "didRemoveTabViewItem" may be better named "willRemoveTabViewItem".

Reported by Michael Edgar · July 18th, 2009 @ 02:56 PM

State: new
Milestone: none
Assigned to: nobody

Activity

No comments yet.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.