nsview

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) repurpose to that effect. I've been reading the manual regarding views, and I understand ...

Objective C Printing: How to set header content?

Hi there, I want to print a specific NSView. When I do this, I wish to add content to the header of the print page. e.g. If the NSView contains a picture of a cat, when I press print, print preview shows up with the picture of the cat. I want the print out to be a picture of a cat, with the caption: "Cat" in the header, which I do not...

keyUp event heard?: Overridden NSView method

UPDATED: I'm now overriding the NSView keyUp method from a NSView subclass set to first responder like below, but am still not seeing evidence that it is being called. @implementation svsView - (BOOL)acceptsFirstResponder { return YES; } - (void)keyUp:(NSEvent *)event { //--do key up stuff-- NSLog(@"key up'd!"); } @end --OR...

NSView in NSMenu -- how to make "key" for accepting keyboard commands [specifically, return]

I have a text field and a button living in a view inside a menu item. The button submits the string in the text field to a function, and that works fine. However, I've also set the button's key equivalent to "return." The key command isn't being picked up, probably because the menu is not the "key" window. I know how to make a window th...

Inserting image into NSViews pageFooter

Hello all, I've been trying to insert an image into the page footer of a custom NSView, so that when I print it, it will display text and an image in the footer. Here is the code that I am using: - (NSAttributedString *)pageFooter { NSString *imgName = @"Logo.tif"; ...

Getting started with cocoa drawing

I want to do some custom drawing in a NSView subclass where should I get started? ...

Changing a NSWindow view in code

I would like to have a detail view come in to focus when the user double clicks on a table view row. How would I change a window's view in code? ...

Fading in one view for another

Here's my code: - (IBAction)showTaskDetailView:(id)sender { [window setContentView:viewTaskView]; } How would I fade out the current view and fade in the detail view? ...

How to update a section of an NSView without redrawing the whole view.

I have a NSView where I draw thousands of NSBezierPaths. I would like to highlight (change fill color) the a selected one on mousemoved event. At the moment I use in mouseMoved function the following command: [self setsetNeedsDisplay:YES]; that force a call to drawRect to redraw every path. I would like to redraw only the selecte...

Can NSDockTile accept mouse events?

As the title states, I've tried adding standard NSResponder methods to the NSView subclass that I'm using with my app's NSDockTile, but it doesn't accept any kind of events. Has anyone successfully done this? (Is it possible?). ...

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 NSWindowDidBecomeMainNotification and redrawing the tab bar but I am not sure how to calculate the new gray color for...

NSView inside self window

I have basic *.xib file, which have NSView. How can I use another nib files for this Custom View? What is NSViewController and how should I use it? ...

NSViewController. Core Animation sublayer not drawing.

Hi, I create NSViewController. It manage my view hierarchy and set other views in one NSBox. - (void)displayViewController:(ManagingViewController *)vc { NSWindow *w = [box window]; NSView *v = [vc view]; [box setContentView:v]; } I have two alternate views. The views have Quartz Composer root layer and CALayer sublayer. // ...

How to register user activity in an NSView

I'm trying to register specific user activity in a view. I have an NSView that has a NSTextField, a NSDatePicker and a NSButton (checkbox). I want to know when the user enters into the text field or the picker or when he/she clicks the checkbox. I'm currently using hitTest but it fires a bunch of times even when I just move the mouse...

Cocoa's NSView getting insane mouseDown events ?

Hullo all - I've got a NSView subclass that I move programmatically on mouseDown. Which works, but has an odd side effect: I click the subview. The subview moves away [GOOD] I wait a while. I do not move my mouse. Since the subview has moved it's no longer under my cursor. I click my mouse again. I expect the underlying window to get ...

Property Editor Control for Cocoa?

Is there any Cocoa Widget which i can use to build a typical (well except in Interface Builder) GUI builder property inspector like RealBasic or Delphi has? And is there a website where additional 3rd party Cocoa widgets are listed? ...

How do I check if a NSView is being displayed at the moment?

I got an application which has a NSToolbar in its main window. Depending on which icon is clicked a NSView is displayed in this window. My problem is, that one of these views shows data in a NSTableView that I want to be reloaded each time the view is visible. Since -init is only called once, I don't know how to do that. (example: When t...

Drawing a NSImage into NSView subclass

Here's my code so far (in the draw rect): // Drawing code here. NSLog(@"%@", [[NSBundle mainBundle] pathForResource:@"NoiseBGMainView" ofType:@"jpg"]); NSURL *pathToBGImage = [[NSURL alloc] initWithString:[[NSBundle mainBundle] pathForResource:@"NoiseBGMainView" ofType:@"jpg"]]; NSImage *NoiseBGMainView = [[NSImage alloc] initWithConten...

NSTrackingArea with fullscreen window/view

I'm trying to install a NSTrackingArea into a fullscreen view in order to get mouse moved events. However, whenever I do, I get an assertion error. I've searched the web, but have not been able to find any leads. *** Assertion failure in -[_NSFullScreenWindow _setTrackingRect:inside:owner:userData:useTrackingNum:install:], /SourceCach...

Cocoa: Create draggable zones

How can I create draggable zones in cocoa and be able to drag and drop images between the two. Ex: Zone 1:no image Zone 2:image drag zone 2's image to zone 1, and be able to save (core data) the location of the image. Would I have to do something like this: http://developer.apple.com/Mac/library/documentation/Cocoa/Conceptual/Dragan...