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 ...
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...
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...
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...
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"; ...
I want to do some custom drawing in a NSView subclass where should I get started?
...
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?
...
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?
...
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...
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?).
...
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...
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?
...
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.
// ...
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...
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 ...
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?
...
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...
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...
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...
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...