• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSOutlineViewWill Expand/Collapse notifications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOutlineViewWill Expand/Collapse notifications


  • Subject: Re: NSOutlineViewWill Expand/Collapse notifications
  • From: Corbin Dunn <email@hidden>
  • Date: Thu, 8 Jun 2006 10:30:35 -0700

On Jun 7, 2006, at 6:34 PM, Ken Victor wrote:

i'm registered for outline view will expand/collapse notifications. the documentation clearly states that these notifications are sent BEFORE the associated clicked row is expanded/collapsed as follows:

Posted before an item is collapsed (after the user clicks the arrow but before the item is collapsed).
The notification object is the NSOutlineView object that contains the item about to be collapsed. A collapsed item's children will lose their status as being selected. The userInfo dictionary contains the following information:


and:

Posted before an item is expanded (after the user clicks the arrow but before the item is collapsed).
The notification object is the outline view that contains an item about to be expanded. The userInfo dictionary contains the following information:


yet, in my notification routine when i checked the state of the item via [NSOutlineView isItemExpanded:] its as if the notification is sent AFTER the item has expanded/collapsed.

is this a known bug? or is this a documentation bug?

Well, to be extra ambiguous, yes and no (to both questions).

The logic is as follows:

The expanded state of the item is set to the new value
The notification is sent.
The logic that adjusts the number of rows happens.

So, in one respect, the expand/collapse hasn't really happened at the point of the notification, but asking isItemExpanded: will return the correct thing for what is going to happen (but, it really hasn't happened yet).

Is this a bug? well, people may depend on it working this way, and in some respects it is considered correct.

Is there a different bug on Tiger with regards to this? Yes! Unfortunately, the numberOfChildren: datasource method is called BEFORE the "willExpand" notification is sent. I definitely see this as an error, and this is fixed on Leopard.

thanks,
Corbin

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSOutlineViewWill Expand/Collapse notifications (From: Ken Victor <email@hidden>)

  • Prev by Date: Creating table cells with multiple controls
  • Next by Date: NSBorderlessWindowMask causes grey disabled controls?
  • Previous by thread: NSOutlineViewWill Expand/Collapse notifications
  • Next by thread: NSMovieView wont accept clicks w/ a borderless window
  • Index(es):
    • Date
    • Thread