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 access NSViews from other classes

Before I start, I am a beginner, so please don't overwhelm me. (even-though I probably did with you sorry) :/ So basically I have 1 main view (NSView) onto which I am loading other views. So my awakeFromNib method works and it loads my start menu…
jundl77
  • 476
  • 2
  • 15
0
votes
1 answer

Where is this NSView being deallocated to cause bad access error?

I am writing an application where the user should be able to click on a button and have the views switch. I have created IBActions that load my method switchSubView on the desired view, but have been having some issues in doing so. I have currently…
ra1nmaster
  • 662
  • 1
  • 8
  • 21
0
votes
1 answer

Showing NSView with a button click

I'm trying to write a program that draws a Sierpinski Carpet, so user should choose the depth of recursion and click a button and then a window with the carpet should appear. But I'm a beginner so I don't know how to connect a button to a function…
0
votes
1 answer

NSColor colorWithPatternImage: Vs. NSImage drawInRect:fromRect:operation:fraction:

So I'm trying to set the background of a view as an image, and I read in another thread that to avoid repeating the image, one should use NSImage drawInRect:fromRect:operation:fraction: rather than NSColor colorWithPatternImage: However, when I use…
Matt Cooper
  • 2,042
  • 27
  • 43
0
votes
1 answer

Mac OSX App Drop Down menu

How do I create a drop down menu that I can add as a subview to an NSView in an OSX app? I've been looking online and can't really find any information on the subject.
user1855952
  • 1,515
  • 5
  • 26
  • 55
0
votes
1 answer

Translating a view with a path (ObjectiveC, Cocoa)

The short story is that I would like the bounds (I think I mean bounds instead of frame) of a NSBezierPath to fill a view. Something like this: To generate the above image I scaled/translated each point in my created path using the information from…
John Smith
  • 363
  • 3
  • 13
0
votes
2 answers

Load NSView from viewcontrollernib

So I have a viewcontroller customViewController that I placed several NSViews on top of using a nib file. I have connected those views to IBOutlet properties in the CustomViewController.h file but now I don't know what the next step is to initialize…
user1855952
  • 1,515
  • 5
  • 26
  • 55
0
votes
1 answer

NSScrollView with CA layer mask adds a second useless scrollbar

I added a custom NSScrollView for a table, and in order to keep everything masked within the window shape I used core animation layer masks to clip it and it's subviews like so: - (void)drawRect:(NSRect)dirtyRect { [super drawRect:dirtyRect]; …
Luke
  • 4,908
  • 1
  • 37
  • 59
0
votes
0 answers

My NSView View resizes to it's original size whenever i resize my window

This is what i am doing Create a new 10.9 cocoa application Drag a drop a custom view to the top right corner - by leaving the default size of the custom view In Appdelegate.h i create this line by cmd+drag -> @property (weak) IBOutlet NSView…
user226372
  • 165
  • 1
  • 9
0
votes
1 answer

NSSearchfield's content misaligned

Since upgrading to 10.9 Mavericks, I noticed that the content of all NSSearchfield instances are misaligned: both the magnifying glass icon, the textfield itself and the clear button are moved down a little bit. Any idea what could be the reason?
Raffael
  • 1,119
  • 10
  • 20
0
votes
1 answer

How to stop click thought an NSView?

I am making app with cocoa(Mac desktop application). I have a NSButton in background of an NSView. The button is clicked even if any NSView is added later in NSWindow. How to stop click on a button that is at background any NSView ? Please give…
0
votes
1 answer

Layering of NSImageView above UIButtons

I have a layering problem with two existing buttons and a NSImageView. I have a custom view called PhotosView which inherits from NSView with two buttons (arrows): @interface PhotosView : NSView - (void)setPhoto:(NSURL *)path; @end In the…
Mirco Widmer
  • 2,139
  • 1
  • 20
  • 44
0
votes
0 answers

NSLayoutConstraint behaving differently when drawing to NSBitmapImageRep

I have this control called ITNavigationView on Github. It's smoothly animating from one NSView to another by caching and adding them to a NSImageView. When caching the view, a subview centred in the x axis will be pulled exactly 1 pixel to the…
IluTov
  • 6,807
  • 6
  • 41
  • 103
0
votes
3 answers

Drawing tabs in an NSView

I am working on implementing tabs for my application. Everything is working well except I can't figure out how to draw the tabs in a lighter shade of gray when the window resigns main status. I am successfully receiving a…
calvinlough
  • 362
  • 3
  • 13
0
votes
3 answers

Disabling NSView fade animation for NSView `setHidden:`

I am working on a project that has the concept of draggable controls, everything is working fine except that NSView seems to employ a fade in/out animation when calling setHidden:. I have been able to work around the problem by changing the line…
Brad Allred
  • 7,323
  • 1
  • 30
  • 49