Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing Border from NSBrowser

As the title says, I actually want to remove the border from an NSBrowser control. The parents are NSView and NSControl. There's no available methods in NSBrowser itself, and neither in the parent controls. This one seems completely undocumented.

As to the reason for removing the border, because it's programatically docked into another view, so the view hierarchy means there's a border already.

Any ideas?

like image 255
Kezzer Avatar asked Jan 18 '13 09:01

Kezzer


2 Answers

Just embed it a plain NSView ("Custom View" in IB) and make the browser's frame "outset" by 1 point in all directions from the containing view's bounds. The containing view will clip the browser to eliminate the border. Then place that containing view into the surrounding view hierarchy, rather than adding the browser directly.

like image 95
Ken Thomases Avatar answered Sep 21 '22 12:09

Ken Thomases


NSBrowser uses NSBrowserCell to implement its interface. That inherits from NSCell. NSCell should provide the methods you need.

From NSCell class reference... Managing Display Attributes – setBezeled: – isBezeled – setBordered: – isBordered – isOpaque – setControlTint: – controlTint – setBackgroundStyle: – backgroundStyle – interiorBackgroundStyle

like image 32
uchuugaka Avatar answered Sep 21 '22 12:09

uchuugaka