Questions tagged [nsview]

NSView Implements basic drawing, event handling and printing behaviors for applications. Usually application code define subclasses of NSView to provide richer implementations. Belongs to the Foundation framework for Cocoa and Cocoa Touch.

The NSView class defines the basic drawing, event-handling, and printing architecture of an app. You typically do not use NSView objects directly. Instead, you use objects whose classes descend from NSView or you subclass NSView yourself and override its methods to implement the behavior you need. For any view object, there are many methods that you can use as-is.

1639 questions
0
votes
1 answer

How to make a NSTextField added to a NSView Draggable

Let me elaborate the steps i am doing Create Mac 10.9 Project Drag a CustomView (Let's call it myView) to the .xib Drag a NSButton to the .xib but out side the CustomView Now programatically (using a other class) i add a NSTextField to the…
user226372
  • 165
  • 1
  • 9
0
votes
2 answers

Objective-C tiled background image in NSview

I have 2 NSViews arranged side by side that have backgrounds made from tiled images. When I add constraints to the views so that they resize with the main window the tiled background image no longer displays and the background is just black. What am…
dmid
  • 483
  • 4
  • 18
0
votes
2 answers

NSTableView and scrolling background NSColor : Automatic Elasticity Color

I have succesfully changed the background NSColor of my NSTableView using setBackgroundColor: for both the NSTableView and the NSCell (using tableView: willDisplayCell:forTableColumn:row:). Now, I would like the background to also have this color…
Bertrand Caron
  • 2,525
  • 2
  • 22
  • 49
0
votes
3 answers

Text on label not set when window appears

I've made a small Cocoa Application with a custom MyWindow.xib and a MyWindowController. The window contains a NSTextField (label) and from my AppDelegate I'm initializing this controller and it's view, setting a text on the label and displays the…
dhrm
  • 14,335
  • 34
  • 117
  • 183
0
votes
1 answer

Drawing shadow around NSImageView

I'm trying to draw shadow under an NSImageView. I'm accessing the CALayer of the view and setting its shadow properties there: [self.originalImageView setWantsLayer:YES]; CALayer *imageLayer = self.originalImageView.layer; [imageLayer…
Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389
0
votes
1 answer

Not able to drag my transparent window

For my OSX application. I have a main window with some output. On a button click a new window will pop up with a drawing on its NSView. I am making this second window transparent by setting its background color as transparent with RGB values as 0.0…
0
votes
2 answers

Cocoa how to handle multiple views?

I'm have done some development on iOS using Storyboards. Now I'm building on app for Mac OS X and it seems that an equivalent for Storyboards does not exists. For instance, I'm need to build some kind of wizard, which contains four different windows…
dhrm
  • 14,335
  • 34
  • 117
  • 183
0
votes
1 answer

Stop CALayer to blur the whole parent view

I'm trying to build a blurred, iOS 7 like NSView, which blurs the background. So far it's working fine by applying a Gaussian background filter to the layer-backed NSView. The problem is that not only the area right underneath the view gets blurred,…
Raffael
  • 1,119
  • 10
  • 20
0
votes
2 answers

Custom NSView draws over controls on top of it

I have an NSView with a custom subclass that draws a grid of rounded rectangles inside it. This NSView was placed with interface builder and on top of it I have some NSButtons. The problem is that sometimes when the view is re-drawn (ie, when i…
Mark Wheeler
  • 587
  • 2
  • 6
  • 19
0
votes
0 answers

DrawRect not called from main view

I am writing a MacOS application and my main view is in the main AppDelegate file, defined in the IB. How can I have a DrawRect called when I resize the main window ? All examples I read are based on an additional view started with initWithFrame,…
Laurent Crivello
  • 3,809
  • 6
  • 45
  • 89
0
votes
1 answer

Unable to properly position NSImageView in NSView

I would like to display an NSImageView in my main View: img=[[NSImageView alloc]init]; [img setImage:[[NSImage alloc]initWithContentsOfFile:filename]]; width=img.image.size.width/2; height=img.image.size.height/2; [img setFrame:NSMakeRect(0,0,width…
Laurent Crivello
  • 3,809
  • 6
  • 45
  • 89
0
votes
2 answers

Can i use a button within a NSview to change views using NSViewController?

I have a view controller and 5 views. Currently I use a pop-up in mainMenu.xib to access the NSObject AppController which uses the view controller to change between views. I know that using storyboards in IOS you can use a button within a view to…
NoNameHere
  • 48
  • 6
0
votes
1 answer

Click on NSBezierPath

I'm drawing a NSBezierPath line on my NSImageView. I'm creating NSBezierPath object, setting moveToPoint, setting lineToPoint, setting setLineWidth: and after that in drawRect of my NSImageView subclass I'm calling [myNSBezierPath stroke]. It all…
jovanjovanovic
  • 4,158
  • 3
  • 22
  • 32
0
votes
1 answer

NSView that resizes like UserDefaults, basically to fit content

I'd like a NSView to resize (larger and smaller) based on its currently viewed sub view. This is seen most often in UserDefaults but I would like it for a Modal Window. I'm using a NSTabView inside the Window with 4 tabs. Each tab have quite…
Gabe Rainbow
  • 3,658
  • 4
  • 32
  • 42
0
votes
1 answer

NSView won't draw through bezierpath

Dear fellow Cocoa programmers, What I'd like to accomplish: I have a checkbox, a popUpButton(which is hidden) and a NSView on my canvas. If myCheckbox is checked -> show the popUpButton and draw a line through bezierPath on the NSView. if…
Verbe
  • 634
  • 7
  • 13