kCFStreamPropertyFTPFileTransferOffset and Resuming FTP uploads

2010-10-21 Thread David Alter
Does anyone know if kCFStreamPropertyFTPFileTransferOffset is implemented? According to this conversation back in 2007 it is not http://lists.apple.com/archives/macnetworkprog/2007/Mar/msg00067.html I need to provide pause and resume support for FTP and FTPS uploads in a cocoa application. I have

Looking for a FTP framework

2010-08-10 Thread David Alter
I'm adding FTP support to a Mac application. It actually needs to support SFTP. I need to support upload and downloading. If a connection is dropped I need to be able to re-establish a connection and finish the operation. It looks like there are some choices out there and I wanted to see what

NSWindow dataWithEPSInsideRect: giving error on 10.5

2010-05-21 Thread David Alter
I have a NSWindow that when I call dataWithEPSInsideRect: on it, I get the following error appearing in the Console. Error: CMSStreamPSDefinition : CMGetPS2ColorSpace: returned -4200 I only get the error if it is running on 10.5. It works great on 10.6 What I'm trying to do is create an image

setting NSScrollView content width to NSText width

2010-03-16 Thread David Alter
I dynamically create a NSScrollView and place and NSTextView inside of it. I want the width of the content view to expand with the text. Basically the same way the xCode editor works. The horizontal scroll bar adjusts as texts is added. The width of the content view is the width of the longest

calling the run method in an AppleScript from a cocoa application

2010-03-12 Thread David Alter
I need the ability to call an AppleScript from a Cocoa Application. I have done this in the past using NSAppleScript and it works great. This time I need to call the on run and pass in parameters. That I have not done. I looked at the following Tech note Technical Note TN2084: Using AppleScript

Arrow keys not working in NSTabView

2010-03-03 Thread David Alter
I have dynamically created a NSTabView and added NSTabViewItems to it. It works with the exception of if the NSTabView has the focus I can not use the right and left arrow keys to navigate to the other tabs. The arrow keys work if I create the tab view with IB. I'm not sure what is different. I

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 {

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

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

Re: Looking up a NSString constant at runtime

2010-01-04 Thread David Alter
constant:@ NSDeviceResolution']; any idea? -dave On Mon, Jan 4, 2010 at 2:19 PM, Oftenwrong Soong oftenwrongso...@yahoo.comwrote: On Mon, Jan 4, 2010 at 4:56 PM, David Alter alterconsult...@gmail.com 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 scott_r...@killerbytes.comwrote: What if I'm getting a string passed in that is the name of the

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

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 kyle.slu...@gmail.com wrote: On Wed, Oct 14, 2009 at 2:42 PM, David Alter alterconsult...@gmail.com wrote: I need to set

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.

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

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

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

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

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

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)

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.

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.

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

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

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

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 michael@gmail.com wrote: On Mon, Feb 23, 2009 at 4:51 PM, David Alter alterconsult...@gmail.com 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

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

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

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

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 create a

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

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

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

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

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

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 -

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 *)theEvent

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