• 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: Bound NSBrowser always shows horizontal scrollbar
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bound NSBrowser always shows horizontal scrollbar


  • Subject: Re: Bound NSBrowser always shows horizontal scrollbar
  • From: Jeremy Dronfield <email@hidden>
  • Date: Sun, 25 Jun 2006 10:04:43 +0100

On 24 Jun 2006, at 4:42 pm, Glen Low wrote:

I have bound the content, contentValues and selectionIndexPaths of a NSBrowser to a suitable NSTreeController. Everything works swimmingly, except that although I set it to hide horizontal scrollers, they keep on coming back when I click on various browser items, even when the depth is less than the visible depth of the browser. Any way of permanently inhibiting the horizontal scroller display behavior?

I'm not sure if this answer meets your case, since it's not clear whether you want to suppress the horizontal scrollbar completely or just rectify its autohide behaviour. Assuming the latter, I found the same problem and ended up using the following kludge. (In my case I put this code in -browserColumnConfigurationDidChange:. Alternatively it could be called when the browser selection changes.)


float totalWidth = 0;
int index, lastIndex = [browser lastColumn];
for (index = 0; index <= lastIndex; index++)
totalWidth += [browser frameOfColumn:index].size.width;
/* First check if total column widths are greater than the visible width of the browser */
BOOL showScroller = totalWidth > [browser visibleRect].size.width ? YES : NO;
/* In some cases, the column widths may be less than the visible width but the leftmost column
is still outside the view, therefore still requiring a scrollbar. */
if (!showScroller)
showScroller = [browser frameOfColumn:0].origin.x < 0 ? YES : NO;
[browser setHasHorizontalScroller:showScroller];


It's a bit ugly but it works for me.

Regards,
Jeremy
_______________________________________________
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: 
 >Bound NSBrowser always shows horizontal scrollbar (From: Glen Low <email@hidden>)

  • Prev by Date: Re: CoreData: Getting the last object of a relation
  • Next by Date: Re: Helper Tool on FireWire
  • Previous by thread: Bound NSBrowser always shows horizontal scrollbar
  • Next by thread: Programmatically toggle display to white on black
  • Index(es):
    • Date
    • Thread