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 pass a value to a NSView SubClass

i created a clock by SubClassing the NSView. now i want create many clocks programatically and pass the time zone value to each and every clock. how can i pass the desired timeZone value to the subClassed NSview.
Muruganandham K
  • 5,271
  • 5
  • 34
  • 62
0
votes
0 answers

how work NSViewController containment in cocoa?

I have worked a lot with the UIKit from iOS SDK, now I'm getting familiar with the cocoa framework to develop applications for MacOS X. UIViewController has functions to implement the view controllers containment to make the UIViewController and the…
Jpellat
  • 907
  • 7
  • 29
0
votes
1 answer

A vertical Array view, probably NSOutlineView

Im seeking a tutorial/solution using a NSView where the array is displayed vertically. This NSView is then placed in the NSScrollView for vertical scrolling up/down. Its a bit like a 'NSTableView' but with 1 column. That one column contains many…
Gabe Rainbow
  • 3,658
  • 4
  • 32
  • 42
0
votes
1 answer

Subview of subclassed NSView re-positioned incorrectly after drawing a focus ring

I wanted to create a focus ring outside a subclassed NSView to identify selection. My reference comes from here: Link. I followed the reference, overwrote the -drawRect method as: @property (nonatomic) BOOL shouldDisplayFocus; ... -…
Andrew Chang
  • 1,289
  • 1
  • 18
  • 38
0
votes
1 answer

Do Layer Backed NSViews Break the View Hierarchy?

I am trying to create an application where movies are played in NSViews that may move behind other views. I want to use AVFoundation so I will be rendering video to an AVPlayerLayer. However, video is always played on top of everything else, and…
Giles
  • 1,428
  • 11
  • 21
0
votes
1 answer

NSView drawRect: being erased

For some strange reason parts of my NSView are being erased when another view comes in contact with it. I imagine this is some sort of layer issue, would I be correct in believing that? My first thought was to just constantly redraw the NSView…
Atlas Wegman
  • 569
  • 2
  • 10
0
votes
1 answer

Why NSView animator doesn't work in Cocoa

I have a NSView in my project that I want to move but the animation I usually use for other objects doesn't work with it... what should I do to make it move? Here is my code: [[NSAnimationContext currentContext] setDuration:1.0]; NSRect rect =…
Blue
  • 2,300
  • 3
  • 21
  • 32
0
votes
1 answer

How to draw EPS data on NSView

I'm struggling with the problem to draw an eps file on a NSView. When I first load the eps file from a file and draw it with drawInRect: the image is displayed correctly. However, the image will not be drawn when I load it from an archive file. I've…
cocoafan
  • 4,884
  • 4
  • 37
  • 45
0
votes
1 answer

Scaling drawing done in drawRect when view resizes

I'm still learning some of the ins and outs of custom view drawing in Cocoa. I have a custom view where I draw lines and points based on the corresponding points in a larger rect elsewhere of a fixed size. I would like to have my drawing scale up…
uchuugaka
  • 12,679
  • 6
  • 37
  • 55
0
votes
1 answer

How to Change NSTableColumn width with Animation

I have a NSScrollView and a NSTableView with some NSTableColumn in it. When I push a button,I change the NSScrollView'width with Animation. Here is my code: NSDictionary *myScrollViewDictionary = [[NSDictionary alloc] initWithObjectsAndKeys: …
0
votes
3 answers

Objective-C: How to switch the NSView by button click

I have different xib files with NSViewController attached to them. (Screenshot below) One of xib file called StartMenuViewController which has a button. I want to click that button and change the view to DetectingUSBViewController.(Screenshot…
YU FENG
  • 888
  • 1
  • 12
  • 29
0
votes
1 answer

NSView keyDown not called during drag and drop in Cocoa application

I have a cocoa application where i need to respond to keyDown events during dragging sessions in order to trigger other things. The keys are not modifiers only but can be any kind of key. The problem is, when i start a dragging session by calling…
vosc
  • 108
  • 8
0
votes
1 answer

objC sending key events from NSView to another obj

I'm very new to objC and game programming in general, so excuse me if this is a question many of you could do [self facepalm]; I'm trying to setup a game loop (NSObject) as a controller. Also there is a NSOpenGLView connected with the Window via…
0
votes
2 answers

NSView invisible unless I override drawRect, and then it gets clipped even if setMasksToBounds is NO on superview's layer

Trying to add a NSView to an existing NSView, but I'm failing miserably for some strange reason. I'm doing this: _resizeView = [[NSView alloc] initWithFrame:NSMakeRect(0, 0, 10, 10)]; [_resizeView.layer setBorderWidth:2]; …
Christian A. Strømmen
  • 3,181
  • 2
  • 25
  • 46
0
votes
2 answers

Drag Drop delegate for NSView could not set an attribute

I am using NSView delegate to read the dragged excel values. For this I have subclassed NSView. My code is like- @interface SSDragDropView : NSView { NSString *textToDisplay; } @property(nonatomic,retain) NSString *textToDisplay;…
triandicAnt
  • 1,328
  • 2
  • 15
  • 40
1 2 3
99
100