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

Copies of NSRects not displaying

I am trying to make a simple Cocoa program. I have a little black box (a subclass of NSView drawing an NSRect on screen) following my mouse around. That part I have working. What I need for it to do is: when I click the mouse I want to leave a…
0
votes
2 answers

Scroll NSScrollView contents to specific point, programmatically

OK, this thing has been bugging me for quite some time. I've got an NSScrollView (X= 258, Y= 322, W=516, H=653) with a view in it (X= -283, Y= -215, W= 1800 H= 1800), and I'm desperately trying to make it scroll to the top-left corner. I've tried…
Dr.Kameleon
  • 22,532
  • 20
  • 115
  • 223
0
votes
0 answers

Cocoa - set image and alternateImage for NSView as NSStatusItem in status bar

I wanted to drop files in status bar app icon, so I've found implementation code that allows use NSView as NSStatusItem. I'm trying to set image directly to view, but nothing happens I still getting empty status bar item. The menu works fine, just…
Evg Min
  • 1
  • 1
0
votes
1 answer

How to get reference of base NSView used by NSPopover

The question is pretty straightforward. I have a NSPopover property, that I use to present some information when the user clicks in a NSView of mine. Here's how I present the popover: [self.boxPopover showRelativeToRect:NSMakeRect(0, 0,…
Lucas Eduardo
  • 11,525
  • 5
  • 44
  • 49
0
votes
1 answer

Highlight NSImageView in NSView

I have a simple question. I have my NSView which is detecting drops (drag and drop). When user drops a link with image from browser, I detect that action, create NSImageView, initialize it on a place where user dropped it with some default frameSize…
jovanjovanovic
  • 4,158
  • 3
  • 22
  • 32
0
votes
2 answers

How do you change which view is active in a window?

The program I'm working on right now is a bit cumbersome, as it starts with a central menu, and then once the user chooses an option from it it opens their selection in a new window, when I've got a perfectly good window I can (at least apparently)…
Kaji
  • 2,220
  • 6
  • 30
  • 45
0
votes
1 answer

NSBezierPath on a NSView aren't lining up correctly

I have an NSWindow with a NSView (stored in a nib): I'm trying to add a BezierPath to a layer for that view (self.view2): CAShapeLayer* circleLayer = [CAShapeLayer layer]; [self.view2 setLayer:circleLayer]; circleLayer.fillColor = [NSColor…
James
  • 1,689
  • 3
  • 17
  • 21
0
votes
1 answer

WebView not reacting to frame size changes in resizeSubviewsWithOldSize

I have a custom view that contains a WebView. My custom view does its own layout in resizeWithOldSuperviewSize: then invokes resizeSubviewsWithOldSize: to resize its subviews. My custom view contains a WebView, an NSTextField, and another custom…
Craig
  • 3,253
  • 5
  • 29
  • 43
0
votes
1 answer

Switching NSViews in NSPopover

I have a NSPopover which contains a view (toolbarView). This toolbar consists of two buttons (button 1 and button 2). When button 1 is pressed, "showView1" method is activated and view1 is added below toolbarView. Similarly, when button 2 is…
m41n1
  • 75
  • 1
  • 7
0
votes
1 answer

What is called before in the NSView removeFromSuperviewWithoutNeedingDisplay when the sub view is destroyed?

I have a crash in my AudioUnit plug-in (running under Logic 9 and Logic X - Mac OS X 10.8.4. Does not reproduce in AU Lab) My AudioUnit plug-ins performs the draw in a separate thread. When a Plug-in GUI is closed the AU plug-in receives a call…
Mr C.
  • 1
0
votes
1 answer

Cocoa: Clicking a view in the background

I'm using a view in a background window that I would like to click and immediately activate a mouseDown event, I currently have to click once for the view's window to activate and click again to run mouseDown. I remember having seen something like…
Elbimio
  • 1,041
  • 2
  • 10
  • 25
0
votes
1 answer

ConvertRect:toView: gives bad rect when app dragged to second monitor

I'm trying to take a screenshot of a view. I'm using the code at the following link, which is working fine with one exception: cocoa: how to render view to image? The problem I have is that if I drag the application window to my second monitor the…
Darren Wheatley
  • 456
  • 1
  • 3
  • 14
0
votes
2 answers

How to clear all object on NSView in Cocoa

I want to clear all objects which added to NSVIew before call any function. How can I do that?
HTKT611
  • 161
  • 1
  • 1
  • 11
0
votes
2 answers

Drawing in NStextField

If you wanted to implement a highlighting for specific substrings in a NSTextField like on the screenshot (Tweetie.app) how would you do it? :) Tweetie Link Highlighting http://qkpic.com/88c61 Thanks for your help!
papr
  • 4,717
  • 5
  • 30
  • 38
0
votes
2 answers

NSView subView not visible after added to superView

this is my final window i added 4 subviews (last 4 in 2nd image) to the base view. but not displaying the view. after manual resizing window the subviews appeared as below. how can fix it?
Muruganandham K
  • 5,271
  • 5
  • 34
  • 62
1 2 3
99
100