NSAnimation subclass calling display on a view

2008-11-24 Thread David Alter
I'm creating an animation using NSAnimation. I have created a subclass of NSAnimation that over loads setCurrentProgress. The delegate is a subclass of NSImageView. When setCurrentProgress gets called I call my delegate display method. My drawRect method in my subclass of NSImageView identifies if

NSAnimation subclass calling display on a view

2008-12-02 Thread David Alter
I'm creating an animation using NSAnimation. I have created a subclass of NSAnimation that over loads setCurrentProgress. The delegate is a subclass of NSImageView. When setCurrentProgress gets called I call my delegate display method. My drawRect method in my subclass of NSImageView identifies if

Drawing in a NSView out side of drawRect

2008-12-19 Thread David Alter
I want to draw in a NSView but not when drawRect is called. To do this I understand that I need to call lockFocus before drawing and unlockFocus after. The drawing appears to happen but it is not until I deactivate the window do I see my results. How can I get it to refresh once I have done my draw

Re: Drawing in a NSView out side of drawRect

2008-12-22 Thread David Alter
> > > CGContextRef myContext = > > (CGContextRef)[[NSGraphicsContext currentContext]graphicsPort]; > > Right now you're getting the current graphics context, which is purely > arbitrary. Nothing has set it yet, so you're getting whatever happened > to be hanging around. Is there a way to crea

Re: Drawing in a NSView out side of drawRect

2008-12-23 Thread David Alter
Thanks to everyone that has responded to me. It has been a big help. > > I want to draw in a NSView but not when drawRect is called. > > Others have pointed this out, but I want to reiterate: no you don't. > Trying to draw outside of drawRect: will only lead to pain. (It is > useful, on rare occa

Finding and NSView in a window

2009-09-16 Thread David Alter
Is there and easy way to find the top most view for a given point in a Window? thanks for the help -dave ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators a

Making a opaque copy of an NSImage

2009-10-01 Thread David Alter
*I have an NSImage that I would like to make a transparent version for dragging. I have used - (void)dissolveToPoint:(NSPoint)aPoint fraction:(CGFloat)delta to do this in the past. That appears to be getting deprecated and I would like to update my code. What is the suggested way of doing things. I

Setting Application cursor

2009-10-14 Thread David Alter
I need to set a cursor for the application when it is in specific states. I have been doing this by creating by cursor and calling set. [[NSCursor crosshairCursor] set]; If the application is deactivated. When you activate the application the cursor needs to be reset. I tried doing this in NSAppl

Re: Setting Application cursor

2009-10-14 Thread David Alter
I do need the cursor to be active everywhere on the screen. In other places we are using NSTrackingArea and that works great. On Wed, Oct 14, 2009 at 2:48 PM, Kyle Sluder wrote: > On Wed, Oct 14, 2009 at 2:42 PM, David Alter > wrote: > > I need to set a cursor for the application w

Receiving mouseEnter and mouseExit events.

2008-08-19 Thread David Alter
I'm a little confused on the mouse tracking. I have a view and I want to track when the mouse enters and exits it. If I set setAcceptsMouseMovedEvents to true for my window, (void)mouseMoved: (NSEvent *)theEvent will get called. But, - (void)mouseEntered: (NSEvent *)theEvent and - (void)mouse

Re: Receiving mouseEnter and mouseExit events.

2008-08-19 Thread David Alter
, David Alter wrote: I'm a little confused on the mouse tracking. I have a view and I want to track when the mouse enters and exits it. If I set setAcceptsMouseMovedEvents to true for my window, (void)mouseMoved: (NSEvent *)theEvent will get called. But, - (void)mouseEntered: (NSEvent *)the

Re: Receiving mouseEnter and mouseExit events.

2008-08-19 Thread David Alter
Figured it out. I just need to use addTrackingRect:owner:userData:assumeInside enjoy -dave On Aug 19, 2008, at 2:50 PM, David Alter wrote: I just realized that NSTrackingArea is 10.5 and up. I need to support 10.4. mouseEntered and mouseExited have been part of NSResponder from 10.0. To

nibless applications

2008-09-02 Thread David Alter
I have a situation where it would make a lot of sense to have a nibless application. I think this situation is unique and would suspect that very few people would need to do this. There is some information on how to do this. Lap Cat Software has some good information on this

issues with mainMenu and initialization timing

2008-09-23 Thread David Alter
I'm working on a x-platform application that is written in Carbon and we are moving it to cocoa. I have it using a native Cocoa run loop as the main event loop. It is a nibless application. I jump through a few hoops for that to work correctly. Now I'm experiencing some very strange behavio

get the drawing text height

2009-01-26 Thread David Alter
I'm drawing a string to screen and I want to get the height if I specify a specific width. I'm drawing the string by using the NSString drawInRect: withAttributes:. I do not see how I can get the height after the text has wrapped. I have looked at NSString sizeWithAttributes, but there does not ap

Getting CGImage out of NSBitmapImageRep in 10.4

2009-02-23 Thread David Alter
I need to get a CGImage out of a NSBitmapImageRep. This needs to work in 10.4. I tried doing this by setting the bitmap as the graphics context and then creating the image form the context. This gives me an CGBitmapContextCreate: unsupported parameter combination. Here is the code NSGraphicsContex

Re: Getting CGImage out of NSBitmapImageRep in 10.4

2009-02-24 Thread David Alter
On Mon, Feb 23, 2009 at 7:42 PM, Michael Ash wrote: > On Mon, Feb 23, 2009 at 4:51 PM, David Alter > wrote: > > I need to get a CGImage out of a NSBitmapImageRep. This needs to work in > > 10.4. > > I tried doing this by setting the bitmap as the graphics context and the

Re: Getting CGImage out of NSBitmapImageRep in 10.4

2009-02-24 Thread David Alter
age from the > CGBitmapContext with CGBitmapContextCreateImage? > > regards, > > douglas > > > > On Feb 24, 2009, at 12:41 PM, David Alter wrote: > > What I want to do is create the NSBitmapImageRep from a jpg. Draw into the >> image and extract a CGImageRef out. I need to

NSSlider changed notification

2009-03-10 Thread David Alter
Hi All, I'm sure this is something basic that I'm just missing. For some reason I can not find how to get a notification when my slider changes value. I want to be able to subscribe to receive a notification if the slider value changes. Is there a delegate method for this? What is the best way to g

Intercepting events from a control

2009-03-10 Thread David Alter
I need to know about events destine for a specific control. Is there a way to receive these events with out subclassing the control. All I have is a reference to the control. I need events like MouseDown, MouseUp. It would also be very helpful if I knew when the control became the first responder a

Simulating a click in NSStepper

2009-04-16 Thread David Alter
I'm using a NSStepper with the little up and down arrows. I want to simulate a click where the correct arrow will get highlighted as if someone clicked into it. I'm unclear how I should do this. I can do a perform click but that does not specify what arrow to click. Any suggestions? thanks for the

custom field editor results in no focus ring

2009-04-23 Thread David Alter
I was looking at using a customer field editor for my NSTextField. I have read over the docs at Text Editing Programming Guide for Cocoa: Working With the Field Editor. In my Window delegate I added the -

NSTextField notification if selection changed

2009-04-27 Thread David Alter
How can I get notification if the Selection changed in a NSTextField. This works with a NSTextView by setting up the delegate - (void)textViewDidChangeSelection:(NSNotification *)aNotification A NSTextField uses a NSTextView for its editing. And the NSTextField is the delegate to the NSTextView. I

NSTextField notification if selection changed

2009-04-27 Thread David Alter
How can I get notification if the Selection changed in a NSTextField. This works with a NSTextView by setting up the delegate - (void)textViewDidChangeSelection:(NSNotification *)aNotification A NSTextField uses a NSTextView for its editing. And the NSTextField is the delegate to the NSTextView. I

Calling a super call method from and instance

2009-05-07 Thread David Alter
In Objective-C 1.0 (not 2.0 ) is there a way to call a super class method if I have a reference to the class See bellow @interface MyClassA : NSObject { } -(void) aboutMe ; @end @implementation MyClassA -(void) aboutMe ; { NSLog(@"I'm Class A"); } @end @interface MyClassB :MyClassA { } -(void) ab

Interpreting action from NSStepper

2009-05-12 Thread David Alter
When a user clicks on my stepper my action method gets called. How can I identify if the user is clicking the up arrow or the down arrow Thanks for the help -dave ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests o

Underlining a Tab item label

2009-05-25 Thread David Alter
With NSTabView I can set the font of the NSTabViewItem label. Is there a way to make it underlined? I have always done this with the NSAttributeString in the past. However I do not see how I can get access to the attribute string for the NSTabViewItem label. thank for the help -dave ___

setting a CGContextRef to the current Context

2009-07-08 Thread David Alter
I have CGContextRef that I use for some quartz calls. It is a bitmap context. I would like to set it as the current context so that I can use NSString drawAtPoint: withAttributes:. I do not see how to do this. NSGraphicContext setCurrentContext: takes a NSGraphicContext and not an CGContextRef. I d

change color on a NSButton

2009-07-21 Thread David Alter
I have a Gradient button. An NSButton with Bezel Style set to NSShadowlessSquareBezelStyle. I would like to make the button appear with the blue highlight at times. The best way for me to describe this is if look at the segment control. It has three states on a segment, not selected, mouse down on

Looking up a NSString constant at runtime

2010-01-04 Thread David Alter
Is there a way to lookup what and NString constant is at runtime? I want to know what the string is for a given constant. For example I would like to pass in the constant name ( i.e. NSDeviceResolution) and get back the NSString that constant represents. I know in this case that the Constant name a

Re: Looking up a NSString constant at runtime

2010-01-04 Thread David Alter
tants constant:@ "NSDeviceResolution']; any idea? -dave On Mon, Jan 4, 2010 at 2:19 PM, Oftenwrong Soong wrote: > On Mon, Jan 4, 2010 at 4:56 PM, David Alter > wrote: > > Is there a way to lookup what and NString constant is at runtime? > > > > Have you tried >

Re: Looking up a NSString constant at runtime

2010-01-04 Thread David Alter
I can open a library and lookup a function by name using dlsym. These constants are EXTERN. It seams there should be away to look these up as well. -dave On Mon, Jan 4, 2010 at 3:39 PM, Scott Ribe wrote: > > What if I'm getting a string passed in that is the name of the constant > and > > I wan

Image of minimized window using 10.4 APIs

2010-01-13 Thread David Alter
I want to get the image of a minimized window that is in the dock and modify it. But here is the catch. I need this to work on 10.4 and up. The API miniwindowImage from NSWindow will only return something if you have modified the image. Is there a way to do this? Another way to do this is if I cou

inspecting return data from NSPasteboard propertyListForType:

2010-01-25 Thread David Alter
I have some generic code for when data is dragged into my application. I wanted to do something like this id data = [[sender draggingPasteboard] propertyListForType:type]; if ( [NSArray isSubclassOfClass:[data class]] or [NSDictionary isSubclassOfClass:[data class]]) { //do a list thing } else {