The NSBox class implements simple views that can title themselves and draw a border around their content. These objects are known as boxes. You can use box to group, visually, some number of other views.
Questions tagged [nsbox]
39 questions
1
vote
1 answer
How to add an line of NSBox programmatically?
In interface builder, we can simply drag a line to the view.
But I want to programmatically assign a line (for example, vertical line) into my view hierarchy, what should I initialize the box before - addSubview: and - setFrame: methods?

Andrew Chang
- 1,289
- 1
- 18
- 38
1
vote
3 answers
Add / Remove buttons in NSOutlineView
I have a Source-View (NSOutlineView) with two Buttons at the bottom. I added an NSBox so that the items don't "shine through" when they're behind the buttons.
This works fine when the window is active:
But as soon as I deactivate the window the…

Besi
- 22,579
- 24
- 131
- 223
1
vote
3 answers
Get Alpha Value Objective-C
How would I get the alpha value of a NSBox and Use it in an if statement?
I want to check the alpha of an NSBox if the value is equal to 0 then do something.
if ([Preferences alphaValue ==0]) {
[[[[Preferences subviews] objectAtIndex:0]…

atomikpanda
- 1,845
- 5
- 33
- 47
1
vote
1 answer
Replacing subviews with NSBox
I would like to use an NSBox *dynamicSection to replace the content of the box with a different view depending on the index selected from and NSPopUpButton control. The method below receives the NSPopUPButton as an object, and uses a case switch to…

user1505130
- 9
- 3
1
vote
3 answers
How to disable NSBox from code
I put several controls (button,textfield,...) in a NSBox. is it possible to disable NSBox that user can't access controls (means can't click on button or write in textfield)?
how about nsview ?
user437064
0
votes
1 answer
ViewController's view not showing in NSBox with cocoa Mac
I'm pretty new to cocoa for Mac development. I'm currently struggling with getting a viewController's view to show up as a NSBox's contentView. The relevant code looks like this:
// AccountsViewController.h. ManagingViewController is a custom…

Anders
- 2,903
- 7
- 58
- 114
0
votes
1 answer
Custom interface object invisible after switching between tabs
My app has a preferences window with a toolbar. Its preferences tab is a separate NSView object. When I put standard buttons, boxes, etc. in each view, switching between tabs work wonderfully, but when I add custom boxes or views, the custom objects…

Nikolai Nagornyi
- 1,312
- 2
- 11
- 26
0
votes
2 answers
Why does my clickable box needs a double click to have a clickcount that is equal to 1?
I have an NSStatusItem that has an NSMenuItem which contains a custom NSView. this NSView contains 3 Subviews of NSBox which are clickable (implemented the mouseDown event). Strangely, when I run the application and I enter the statusItem right…

YannickB
- 3
- 2
0
votes
2 answers
Capture NSBox Subclass to PNG
I'm currently trying to capture the contents of my NSBox subclass to a PNG file. I've found some code that seems to do the trick perfectly (code that I call from my actual subclass):
[self lockFocus];
NSBitmapImageRep *rep = [self…

elliottbolzan
- 1,057
- 1
- 15
- 30
0
votes
1 answer
NSBox background image
How can I set background image a for an NSBox? I know we can put a color, but what about background image?

Swapnil
- 1,858
- 2
- 22
- 49
0
votes
1 answer
NSPopover + NSBox in dark mode tint/gamma issue
I have NSPopover with NSBox and subviews are: MKMapView and NSImageView. In dark mode the whole NSBox adds gamma/tint to all subviews. This doesn't appear in light mode (compare images below). It seems to be something with NSVisualEffectView. How…

Marek H
- 5,173
- 3
- 31
- 42
0
votes
1 answer
Why does my NSBox draw a background? (boxType = .primary)
I realized that suddenly (without me touching the corresponding code) my NSBox has a double visualization. It is as if the Box has a background color and draws its normal rounded frame inside. I added a small screenshot. The parent control is white,…

Wizard of Kneup
- 1,863
- 1
- 18
- 35
0
votes
1 answer
Using forEach function with NSBox array
I have recently used the
Array.forEach{ $0.isHidden = false }
function with NSTextFields for macOS in Xcode 8 using Swift 3. I am trying to do the same thing with NSBoxes. Here is what I am doing:
let Boxes: [NSBox] = [notesBox, manualEditBox,…

Hussein Esmail
- 353
- 5
- 21
0
votes
1 answer
Horizontal Line (NSBox) Remove backshadow - Swift
So i have this app and it uses visual effect view to make the container of the app, in this app i have a line separator using an NSBox and when i run it it comes up with this
you can see it comes up but has kinda like a 1 or 2 pixel outlines…

Eli
- 668
- 2
- 13
- 37
0
votes
1 answer
How to set title of NSBox from an array controller via cocoa- bindings
I have an array controller holding some values, say - subjects. I am displaying these values in a table view. I want to set the title of NSBox as subject in selected row.
I tried to do it in following way:
Binding pane: Title, Controller Key:…

Devarshi
- 16,440
- 13
- 72
- 125