Problem: Glyps get drawn outside Line Fragment Rect.

2008-07-12 Thread chaitanya pandit
In my custom NSTextView i override NSTextContainer's lineFragmentRectForProposedRect: sweepDirection: movementDirection: remainingRect: method to lay text only in certain parts of the text view, so in this method, i return the line fragment rectangles in which i allow text to be laid. The

Updating print panel preview

2008-07-12 Thread chaitanya pandit
I have a document based application in which i need to print about 50-70 pages of NSTextView, the printing is working fine, but in the small print preview shown in the print panel, it doesn't show all the pages. Like if there are say 50 pages to be printed, it'll show only abt 20 pages

How to detect NSTextAttachment deletion

2008-07-14 Thread chaitanya pandit
Hi, I am using a NSTextView and i programatically insert images as NSTextAttachments in the textView. These attachments are shown in an NSTextAttachmentCell by the NSTextView. I want to do some background processing just before the user deletes the image from the textView. This can happen

Re: how do I make chat bubbles using a custom cell

2008-07-16 Thread chaitanya pandit
One idea would be to create an NSBezierPath with the shape of the chat bubble, once u have it you can use the CTGradient calss's [gradient fillBezierPath] method to fill it with an aqua look. The CTGradient project is here: http://blog.oofn.net/2006/01/15/gradients-in-cocoa/ On 15-Jul-08,

Image name for drag and drop from Safari

2008-07-18 Thread chaitanya pandit
Hi, In my application, i allow users to drag and drop images from Safari, however while receiving the drop i cannot retrieve the image name from the pasteboard. If i get the data for URL pasteboard type, it gives the URL up to the image, and not containing the image, what i mean is, if

Flip animation like dashboard widgets

2008-07-18 Thread chaitanya pandit
Is there any way to do flip animation like the one with dashboard widgets when u click the i to change the settings for the widget. Can it be done for NSView? I'd appreciate any help Thanks. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

[SOLVED] Image name for drag and drop from Safari

2008-07-18 Thread chaitanya pandit
Hi, Thanks for your reply, Clipboard viewer did the trick, Its the NSRTFDPboard type that contains the required data. // Get the rtfd data, get the attachment and then get the attachment name from it NSData *nameData = [[sender draggingPasteboard] dataForType:NSRTFDPboardType];

NSTextView displaying a square instead of carriage return

2008-07-23 Thread chaitanya pandit
Hi, I am subclassing NSTextView and there is a weird thing happening, some times it displays a box (snapshot attached) instead of a carriage return. Any idea what might causing this? Thanks for any help. inline: Picture 8.png___ Cocoa-dev

Re: Correct way to commit pending text field edits?

2008-07-24 Thread chaitanya pandit
You need to call this on the NSTextField's cell: setSendsActionOnEndEditing:YES Hope it helps. -Chaitanya On 24-Jul-08, at 10:23 PM, Graham Cox wrote: I have a window with a bunch of text fields. I also have an Apply button which takes the current settings and applies them to the data

QTKit Error loading DesktopVideoOut.component

2008-07-25 Thread chaitanya pandit
Hi, In my application i use a QTMovieView to display/play movies, but whenever init a QTMvoveView i get the following log, Any idea what might be wrong? Thanks for help. Running… =shlibs-removed,shlib- info=[num=116,name=AudioIPCPlugIn,kind=B,dyld-

Re: Getting the Alert volume

2008-07-25 Thread chaitanya pandit
try NSBeep(); - Chaitanya On 25-Jul-08, at 6:13 PM, Mudi Dandan wrote: I need to get the Alert Volume set in Preferences so that I can respect the user's setting when playing alerts with NSSound. I have found GetSysBeepVolume() in CarbonSound/Sound.h but unfortunately it's deprecated since

Re: draw string with ellipsis

2008-07-27 Thread chaitanya pandit
Hi, Heres what u can do, NSString *stringToDraw; // the string to draw NSMutableDictionary *attrs = [NSMutableDictionary dictionaryWithCapacity:2]; NSMutableParagraphStyle *ps = [[[NSMutableParagraphStyle alloc] init] autorelease]; [ps setLineBreakMode:NSLineBreakByTruncatingTail]; [attrs

Re: Access to events in tight loop?

2008-07-28 Thread chaitanya pandit
What you can do is use the NSWindow's nextEventMatchingMask: method to determine the next event, here you can check for events that should discontinue your current processing. So, say if u want to do some processing only while mouse down, and stop if there is a mouse up while you are doing

Searchkit: adding metadata

2008-08-01 Thread chaitanya pandit
Hi, In my application i have to add number of images to the search index using searchKit, but i want to add other information (metadata) about the images in the search index, like suppose a name which will be different that the image's file name in it's file path. I tried using

Re: Opening and Saving an RTFD

2008-08-04 Thread chaitanya pandit
Hi, I'm not sure what exactly you are trying to do but i believe you need to create a NSTextAttachment from the file wrapper and then generate an attributed string out of it. NSFileWrapper* filewrapper = [[NSFileWrapper alloc] initWithPath:path]; NSTextAttachment *attachment =

Re: handling idle events

2008-08-05 Thread chaitanya pandit
Hi, You can use NSNotificationQueue to post your custom notification when the run loop is idle (NSPostWhenIdle), and do the processing in it's listener method. On 05-Aug-08, at 10:16 PM, Jim Crafton wrote: Is there a way to handle idle time in an NSApplication? In Win32 or Carbon, since

NSTypesetter setLineFragmentRect:

2008-08-07 Thread chaitanya pandit
In my application i have TextView with inLine images/attachments, if i try to move the line to a different location using NSTypesetter's setLineFragmentRect: forGlyphRange: usedRect: baselineOffset: the inline attachments don't move with the text, even the drawRect for the

NSTypesetter layoutParagraphAtPoint:

2008-08-12 Thread chaitanya pandit
Hello, Well i've been struggling with this for quite a while and would appreciate if anyone could point me in the right direction. I am trying to implement a custom NSTypesetter, to start with i just want to lay 2 characters, an A and an inline image, thats it. The character A gets drawn

Re: Programmatically place cursor within NSTextField

2008-08-13 Thread chaitanya pandit
Hi, You first have to compute the character index where you need to place the cursor, then create a range with zero length and location = character index, Then get the editor (NSText object) for the text field, you can get one by calling NSWindow's - (NSText

Re: NSTypesetter layoutParagraphAtPoint:

2008-08-13 Thread chaitanya pandit
. In this case, you're not specifying the not shown attribute for the attachment. Attachment glyph should not be shown. Aki On 2008/08/12, at 19:54, chaitanya pandit wrote: Hello, Well i've been struggling with this for quite a while and would appreciate if anyone could point me in the right

Re: Shared NSTextView

2008-08-18 Thread chaitanya pandit
You can share an instance of NSTextStorage and NSLayoutManager with multiple NstextContainer+NSTextViews only if you are displaying same text in all those textViews. But as in your case you will have to use a separate set of above classes for each textView, that means you cannot share the

Re: This document's file has been changed by another application?

2008-08-19 Thread chaitanya pandit
Are you actually saving the contents of the document to a file inside the package? Try to get the document's fileURL and check if it is the same for the first and subsequent save operations, that might give a hint. The problem might also occur if you arbitrarily tweak the fileUrl. -Chaitanya

Re: NSMenuItem - setHidden

2008-08-22 Thread chaitanya pandit
Set the menuitem's menu's setAutoEnablesItems to NO Or you may have an option to do so in IB itself On 22-Aug-08, at 9:28 AM, Stuart Green wrote: Hi, I've got a menu item in my app's root menu that I want to hide. I've referenced it as an IBOutlet as per: IBOutlet id itemToBeHidden;

Re: NSMenuItem - setHidden

2008-08-22 Thread chaitanya pandit
) [itemToBeHidden setHidden:YES]; Still doesn't work. Couldn't see any options in IB to set this. in IB you'd see the option when the NSMenu is selected, not the NSMenuItem Stu On 22 Aug 2008, at 18:26, chaitanya pandit wrote: Set the menuitem's menu's setAutoEnablesItems to NO Or you may have an option

Re: Image in NSOutlineView

2008-09-01 Thread chaitanya pandit
The right place to change the image of the cell would be in the outlineView's delegate method: - (void)outlineView:(NSOutlineView *)outlineView willDisplayCell: (id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item try [[cell image] name] to get the name of the image -chaitanya

Re: Image in NSOutlineView

2008-09-01 Thread chaitanya pandit
As per the initial description of your problem, you just want to change the image of the cell when it is clicked(selected) right? If thats the case then you don't have to deal with checking the image name etc. neither u have to do the setImage stuff in outlineviewSelectionDidChange What

Re: Image in NSOutlineView

2008-09-02 Thread chaitanya pandit
If you want to preserve the state for other cells then you can maintain an instance variable (flag) in the ImageAndTextCell, so in outlineViewSelectionDidChange, you simply get the cell for the selected row and set it's flag to YES, and in willDisplayCell you simply check that flag of the

NSTextView's scroller problem when scaling

2008-09-03 Thread chaitanya pandit
I have a NStextView set up using IB and i am scaling the clipView by using the following code from the textEdit sample code - (void)setScaleFactor:(CGFloat)newScaleFactor { if (scaleFactor != newScaleFactor) { scaleFactor = newScaleFactor; NSView *clipView = [[self

clipView's boundsSize changes after scrollToPoint:

2008-09-04 Thread chaitanya pandit
I have a clipView showing an NSTextView, the clipView is scaled. I see a weird behaviour where sometimes the clipView's bounds size changes after the scrollToPoint: gets called. The change in the bound's height in my case was from 392.66687 to 392.666809. This causes the document view kinda

Find Panel Search Metadata

2008-09-11 Thread chaitanya pandit
Hi, I am trying to implement a custom find panel in the textView, and i need to get the shared find options like 'ignore case', 'starts with' etc. The text view documentation talks about Find Panel Search Metadata, where you have to get the property list for the search options from the

NSFetchRequest

2008-09-19 Thread chaitanya pandit
Hi, List, I have a core data model with 4 entities (viz. Person,Company,Bank and Address) each entity has an attribute ID which is of kind NSString. Now, what i want to do is i already have an ID and i want to find a managedObject with matching ID. What i do right now is i create an

Re: How to hide disclosure triangle in NSOutlineView [10.5]?

2008-09-19 Thread chaitanya pandit
What you can do is create an image which has nothing i.e is transparent and use the following method to set it as the image of disclosure triangle - (void)outlineView:(NSOutlineView *)outlineView willDisplayOutlineCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item {

Creating alias programatically

2008-09-23 Thread chaitanya pandit
Hi, I've been struggling with for quite a while now, what i want to achieve is create an alias of a folder at some location. The alias would also be a folder like we have after creating an alias in the finder. say i have a folder foo in /Users/me/Documents/foo and i want to

Re: Creating alias programatically

2008-09-23 Thread chaitanya pandit
On 24-Sep-08, at 1:47 AM, Nick Zitzmann wrote: On Sep 23, 2008, at 1:13 PM, chaitanya pandit wrote: I've been struggling with for quite a while now, what i want to achieve is create an alias of a folder at some location. The alias would also be a folder like we have after creating

Re: Creating alias programatically

2008-09-23 Thread chaitanya pandit
/ me/Desktop/foo should i pass the first path as fromFilePath? I appreciate your help. Chaitanya On 24-Sep-08, at 2:09 AM, Nick Zitzmann wrote: On Sep 23, 2008, at 2:32 PM, chaitanya pandit wrote: I tried using symbolic link, but if the target file is moved, the link fails, just curious to know

Re: Creating alias programatically

2008-09-23 Thread chaitanya pandit
, 2008, at 2:13 PM, chaitanya pandit wrote: I've been struggling with for quite a while now, what i want to achieve is create an alias of a folder at some location. You may be being tripped up by terminology. An alias is an opaque data structure in memory. An alias file is a file on disk

Re: Creating alias programatically

2008-09-23 Thread chaitanya pandit
On 24-Sep-08, at 3:32 AM, Nick Zitzmann wrote: On Sep 23, 2008, at 3:57 PM, chaitanya pandit wrote: It created an executable file with name foobar alias on desktop but when i try to open it it says chaitanya-pandits-macbook:~ chaitanya$ /Users/chaitanya/Desktop/ foobar\ alias ; exit

Re: Horizontal SplitView Resize Question

2008-09-25 Thread chaitanya pandit
I'm not sure but you can try limiting the min and max coordinate using: - (CGFloat)splitView:(NSSplitView *)sender constrainMaxCoordinate: (CGFloat)proposedMax ofSubviewAt:(NSInteger)offset - (CGFloat)splitView:(NSSplitView *)sender constrainMinCoordinate: (CGFloat)proposedMin

Re: NSOutlineView example

2008-09-26 Thread chaitanya pandit
Have a look at /Developer/Examples/Appkit/OutlineView On 26-Sep-08, at 2:08 PM, Arun wrote: Hello, Does anyone know or has good example code showing how to create a NSOutlineView, create a datasource and information to the datasource and display the final result. I am trying to dispaly a

Re: objc_msgSend_ptr

2008-09-26 Thread chaitanya pandit
if your sizeOfFile: method is returning an integer, then you should convert it to NSNumber like: object = [NSNumber numberWithInt:[[files objectAtIndex:rowIndex] sizeOfFile]]; hth, Chaitanya On 25-Sep-08, at 5:22 PM, Tilo Villwock wrote: i have the following piece of code in my

Code Data: Re-inserting deleted objects

2008-10-02 Thread chaitanya pandit
Hi List, What is the best way to re-insert a deleted object back in to the managed object context? At present i'm trying to this: if ([objectToReinstate validateForInsert:error]) [[self managedObjectContext] insertObject:objectToReinstate]; But i am having problems with objects having

Re: Re-inserting deleted objects

2008-10-02 Thread chaitanya pandit
On 03-Oct-08, at 3:23 AM, Harry Jordan wrote: If deleting the objects was the last action that you did, you could simply call -undo on the managedObjectContext. There may well be reasons why this wouldn't be appropriate, but it's worth a look. Actually thats the first thing that came to

Re: Direct use of NSScroller?

2008-10-02 Thread chaitanya pandit
On 02-Oct-08, at 10:09 PM, James W. Walker wrote: On Oct 1, 2008, at 8:53 PM, Clark Cox wrote: On Wed, Oct 1, 2008 at 7:13 PM, James Walker [EMAIL PROTECTED] wrote: Is it possible to use a scroller without a scroll view? The first problem is that IB won't let me create an NSScroller

Re: NSPersistentDocument No Support Save To (Save As?)

2008-10-08 Thread chaitanya pandit
Hi, I have implemented Save As... in one of my core data app. What i do is, in the saveToURL: ofType: forSaveOperation: error: method, if the save operation is NSSaveAsOperation, i migrate the persistent store to a new location given by the absoluteURL and also set the document's URL to

Re: NSPersistentDocument No Support Save To (Save As?)

2008-10-09 Thread chaitanya pandit
On 09-Oct-08, at 2:52 AM, Mike Abdullah wrote: On 8 Oct 2008, at 20:48, chaitanya pandit wrote: Hi, I have implemented Save As... in one of my core data app. What i do is, in the saveToURL: ofType: forSaveOperation: error: method, if the save operation is NSSaveAsOperation, i migrate

Re: How can be my application notified about user defaults changes?

2008-10-09 Thread chaitanya pandit
NSUserDefaultsDidChangeNotification On 09-Oct-08, at 5:51 PM, Alexander Shmelev wrote: Hello, My program UI depends on what measurement units are used. How can I get notification when AppleMeasurementUnits have been changed by Preferences application? Best regards, Alexander.

Re: NSTableView and drag and drop

2008-10-11 Thread chaitanya pandit
Have a look at /Developer/Examples/Appkit/DragaNDropOutlineView On 11-Oct-08, at 9:06 AM, Chris Idou wrote: I want to be able to drag strings out of a table into another field, but I must be missing something major because drags never get initiated. I've added the delegate, registered drag

Re: NSTableView and drag and drop

2008-10-11 Thread chaitanya pandit
that it can initiate drags? --- On Fri, 10/10/08, chaitanya pandit [EMAIL PROTECTED] wrote: From: chaitanya pandit [EMAIL PROTECTED] Subject: Re: NSTableView and drag and drop To: [EMAIL PROTECTED] Cc: cocoa-dev@lists.apple.com Date: Friday, October 10, 2008, 11:50 PM Have a look at /Developer

Re: Searching a CoreData bound NSArrayController

2008-10-11 Thread chaitanya pandit
I had a similar problem actually, I read on the list somewhere that creating a NSFetchRequest for finding something in the MOC can get slower if you have a lot of objects in your MOC(few thousand), and in such case using an array controller 's array and using predicate to filter it's

Re: Menu binding displaying serialized NSDictionary rather than specified field

2008-10-13 Thread chaitanya pandit
Shouldn't it be: {id: 1, name: @Front} {id: 2, name: @Sports} {id: 3, name: @Opinion} {id: 4, name: @Living} {id: 4, name: @Calendar} note the '@' Chaitanya On 13-Oct-08, at 2:29 PM, Ken Tozier wrote: Hi I have a popup in a table cell I'm trying to bind, programatically, to a simple array

Re: Core Data saving / Leopard / The temporary directory at ...

2008-10-21 Thread chaitanya pandit
Well i'm not a core data pro. but here is what i have observed with core data. If you create an entity and delete it after saving, the deleted entity will be shown in the [[[self managedObjectContext] deletedObjects]allObjects] array. But if you delete the entity immediately after creation

NSPredicate predicateWithFormat:

2008-10-23 Thread chaitanya pandit
Hi list, I have an array controller that manages certain entities, each of the entity has an attribute Name now i want to search for entities with names from a given array, Say i have an array (namesArray) with contents Tom, Matt, Joe now what i do is, i create a predicate which will look

NSPredicate predicateWithFormat:

2008-10-23 Thread chaitanya pandit
Hi list, I have an array controller that manages certain entities, each of the entity has an attribute Name now i want to search for entities with names from a given array, Say i have an array (namesArray) with contents Tom, Matt, Joe now what i do is, i create a predicate which will look

Re: NSPredicate predicateWithFormat:

2008-10-23 Thread chaitanya pandit
Well i could not find any explicit explicit alloc/init method for predicate, I am using Instruments to check for memory leaks, and it shows a memory leak with the array. On 23-Oct-08, at 11:33 PM, Keary Suska wrote: On Oct 23, 2008, at 11:05 AM, chaitanya pandit wrote: NSArray

Re: Core Data Questions--Relationships, UUIDs, and Dirty States

2008-10-28 Thread chaitanya pandit
On 28-Oct-08, at 2:01 AM, Keary Suska wrote: 1. Confirmation clarification: do I understand correctly, considering typical RDBMS data integrity rules, that for most to-one relationships, I would set the delete rule to no action, since deletion of the many item should not effect the one

alpha value from NSBitmapImageRep

2008-10-28 Thread chaitanya pandit
I want to compute the alpha value of each pixel of an image. What i am doing right now is i create a NSBitmapImageRep from the image and use colorAtX: y: to get the alpha value form the color at that pixel. So i need to do this for each and every pixel in the image. I was just going through

Re: alpha value from NSBitmapImageRep

2008-10-28 Thread chaitanya pandit
]; Following this code, myDestinationBuffer has all the alpha data from the image. -Ken Cocoa Frameworks On Tue, Oct 28, 2008 at 2:59 AM, chaitanya pandit [EMAIL PROTECTED] wrote: I want to compute the alpha value of each pixel of an image. What i am doing right now is i create a NSBitmapImageRep from

NSTableView right clicked row

2008-10-28 Thread chaitanya pandit
Hi list, I have a NSTableView, and i display a menu when the user right clicks a row, this menu allows the user to delete that item. My problem is, how do i get the row which was right clicked? Consider this: currently the row#1 is selected and the user right clicks row#3 the row#3's cell

Re: NSTableView right clicked row

2008-10-28 Thread chaitanya pandit
Thanks Randall, funny that my subject says ...clicked row and i missed clickedRow :-) On 29-Oct-08, at 1:51 AM, Randall Meadows wrote: On Oct 28, 2008, at 2:11 PM, chaitanya pandit wrote: Hi list, I have a NSTableView, and i display a menu when the user right clicks a row, this menu

Re: Core Data Versioning: Non-trivial Value Expressions?

2010-05-04 Thread Chaitanya Pandit
]; } } [inManager associateSourceInstance:inSourceInstance withDestinationInstance:newObject forEntityMapping:inMapping]; return YES; } Thanks, Chaitanya Pandit Architect Expersis Software

Re: NSPrintOperation Fails to Auto-Paginate?

2010-05-04 Thread Chaitanya Pandit
Have a look at the TextEdit sample code in /Developer/Examples/TextEdit The MultiPageView handles that Thanks, Chaitanya Pandit Architect Expersis Software Inc. On May 3, 2010, at 9:33 PM, David Duncan wrote: On May 2, 2010, at 7:57 PM, DairyKnight wrote: I've been working on a tool

Noise in CALayer

2010-05-13 Thread Chaitanya Pandit
I'm playing with cover flow in one of my apps with the CovertFlow sample code from apple (http://www.letscocoa.com/CovertFlow.zip) However, sometimes i see a weird noise kinda thing in the shadows, here is a snapshot: http://cl.ly/17ci Any idea what might be going wrong? Thanks, Chaitanya

[Solved]: Noise in CALayer

2010-05-14 Thread Chaitanya Pandit
BINGO! that did the trick! Thanks Bertrand! Chaitanya Pandit On May 14, 2010, at 11:28 AM, Bertrand Landry-Hetu wrote: By the looks of that screen shot I'd suggest you had a look at the bitmap used to fade out the reflection, there is probably a semi transparent gradient being drawn on top

Re: Programmatic Binding

2010-05-18 Thread Chaitanya Pandit
Are you exposing the binding first? + (void)exposeBinding:(NSString *)binding Thanks, Chaitanya Pandit Chief Architect Expersis Software Inc. On May 18, 2010, at 7:47 PM, Richard Somers wrote: I have an issue that has me absolutely stumped. I have a custom view using a custom layer. When

Re: List of all supported apps for file type

2010-05-23 Thread Chaitanya Pandit
You can do CFArrayRef applications = LSCopyApplicationURLsForURL((CFURLRef)fileUrl, kLSRolesAll); to get the applications and then call: - (BOOL)getInfoForFile:(NSString *)fullPath application:(NSString **)appName type:(NSString **)ty To get the application details On May 24, 2010, at 4:27

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Chaitanya Pandit
*3)** **I **can't get t**he right dimensions for a QuickTime movie or poster * NSSize movieSize = [[movieObject currentFrameImage] size]; I used to call GetMovieBox, so I tried using [QTMovie posterImage] but the NSImage reported a width and height of 100, and then my movie poster was

Re: POST request on iPhone

2010-06-01 Thread Chaitanya Pandit
I'd written a sample app, here: http://www.letscocoa.com/2010/02/16/mysqlphp-iphone-app/ Thanks, Chaitanya Pandit Expersis Software Inc. On Jun 1, 2010, at 3:33 PM, Joshua Tucker wrote: Hey, has anyone got any sample code for a POST request for interfacing with an API

Re: Spotlight-Style search menu

2010-06-02 Thread Chaitanya Pandit
I don't know but if you can set your NSStatusItem as a custom view and determine it's location on the screen, you can then show your custom view in a borderless window at that position On Jun 2, 2010, at 9:18 PM, John Johnson wrote: So I know how to set a view in an NSMenuItem, but my

Re: Spotlight-Style search menu

2010-06-02 Thread Chaitanya Pandit
This is the solution I've decided on as well. It's actually a button on a window that I want to trigger the search field to pop down, and I still want it to behave like a menu, i.e. clicking anywhere else on the screen dismisses the menu, and the button get's the pushed in look. What's

CFAttributedString and NSDATA

2010-06-03 Thread Chaitanya Pandit
, Chaitanya Pandit ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http

Re: CFAttributedString and NSDATA

2010-06-03 Thread Chaitanya Pandit
Yeah NSAttributedString is available in 3.2, but what would have been more helpful would be having the AppKit additions of NSAttributedStrings. The CFAttributedString and the NSAtttibutedString in 3.2 looks kinda half hearted effort without the AppKitAdditions Chaitanya Pandit On Jun 3, 2010

draggedImage and draggedImageLocation:

2010-06-14 Thread Chaitanya Pandit
Hey guys, I'm observing a very weird behavior with NSDraggingInfo, I have a NSTextView subclass where i have implemented dragging. When i drag an image from safari and drop it in the textView and try to access the draggedImage from the supplied NSDraggingInfosender, it returns nil. Also, the

UITableView.layer renderInContext: after setContentOffset ?

2010-07-05 Thread Chaitanya Pandit
Hi, List I'm trying to create an image out of a UITableView using the layer's renderInContext Method, however my problem is that i have to create an image of the specific portion of the tableView So i call setContentOffset and then try to generate the image, however this doesn't work and I get

Core Data Migration

2009-12-20 Thread Chaitanya Pandit
. Thanks, Chaitanya Pandit Expersis Software Inc. http://www.expersis.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins

Re: Core Data Migration

2009-12-22 Thread Chaitanya Pandit
Oh sorry, forgot to 'reply all' my bad. Thanks, Chaitanya Pandit Expersis Software Inc. On Dec 22, 2009, at 7:12 PM, Jerry Krinock wrote: On 2009 Dec 21, at 23:16, Chaitanya Pandit wrote: Hi jerry, I think what i'll have to do is if the user closes the doc without saving, just replace

Re: iPhone: NSXMLParser problems

2010-01-06 Thread Chaitanya Pandit
Hi, Are you using the libXML for parsing? Have a look at the XMLPerformance sample code by Apple: http://developer.apple.com/iphone/library/samplecode/XMLPerformance/index.html Thanks, Chaitanya Pandit Expersis Software Inc. On Jan 5, 2010, at 7:13 PM, Eric E. Dolecki wrote: I take that back

Re: Details and the concepts related to the Nib Window

2010-03-23 Thread Chaitanya Pandit
have to look up on NSRunLoop in the Threading Programming Guide I want to see these stuff so that I can modify things accordingly whenever needed. Thanks, Chaitanya Pandit Chief Architect Expersis Software Inc. On Mar 23, 2010, at 3:37 AM, Abhinav Tyagi wrote

Re: Sending a Cmd-V keystroke

2010-03-29 Thread Chaitanya Pandit
Try [windowObject makeFirstResponder:testField1]; instead of [textField1 becomeFirstResponder]; Thanks, Chaitanya Pandit On Mar 26, 2010, at 5:53 AM, Jim Graham wrote: Hi This is a problem that occurred a few months back in a project. I Never actually used it in the project but it has

Re: NSPrintInfo, setting filename for print to PDF?

2010-04-08 Thread Chaitanya Pandit
Hi, You should set the name in the NSPrintOperation object, look at the setJobTitle: method of NSPrintOperation Thanks, Chaitanya Pandit On Apr 8, 2010, at 2:56 AM, Brian Postow wrote: Ok, I'm still working on this from my other question. I can see the printinfo before I run the operation

Core Animation perspective question

2008-11-07 Thread chaitanya pandit
Hi List, iWas going through the Flipr sample app (http://www.brockerhoff.net/src/index.html ) and am trying to understand how to compute the perspective. I could implement the flipping around the Y-Axis in one of my views, but i can't figure out how do i compute the perspective if i would

Re: UI help: visibly disabling NSImageView

2008-11-07 Thread chaitanya pandit
Well generally you can play with cursors to show a point cursor when not editable, cross hair when you allow resizing and hand when allow dragging On 07-Nov-08, at 3:47 PM, Brad Peterson wrote: Hi all, Does anyone have any ideas on how to _visually_ indicate that an NSImageView is not

Detect microphone

2008-11-09 Thread chaitanya pandit
Hi List, I'm using core audio to record sound, however i want to detect if a microphone is connected to the computer, how can i do that? I tried using QTKit to do this: QTCaptureDevice *soundDevice = [QTCaptureDevice defaultInputDeviceWithMediaType:QTMediaTypeSound]; BOOL

Re: Detect microphone

2008-11-10 Thread chaitanya pandit
On 10-Nov-08, at 4:55 PM, Graham Cox wrote: On 10 Nov 2008, at 10:15 pm, chaitanya pandit wrote: Well i tried this before but this doesn't work either Doesn't work covers a multitude of sins; *what* doesn't work? Oh, i was assuming that the AudioHardwareGetProperty method will return

Re: Detect microphone

2008-11-10 Thread chaitanya pandit
: On Mon, Nov 10, 2008 at 2:45 AM, chaitanya pandit [EMAIL PROTECTED] wrote: But on my Mac Mini which doesn't have a built in microphone it still returns YES for isConnected and the device returned is Built-in input That would be the line-in jack. Have you tried asking on the coreaudio-api

[Job Posting] Cocoa Developer Job opening in Pune-India

2008-11-13 Thread chaitanya pandit
Macintosh software development position with a startup company: Location: Pune (India) Requirements: - Bachelor's degree in Engineering - Require knowledge of object-oriented design/programming principles - Knowledge/exposure to Objective-C, Cocoa Framework and Xcode preferred - Passion for the

Changing cursor in NSTextView's Subview

2008-11-14 Thread chaitanya pandit
Hi, List I have a NSTextView with some subviews, i want to implement tracking areas for the subViews so that whenever the mouse enters a subview the cursor changes to open hand cursor. I referred the Trackit example (http://developer.apple.com/samplecode/TrackIt/index.html#/

Re: How do you get the OS X version number in C or C++?

2008-11-14 Thread chaitanya pandit
+ (BOOL)MacOSTigerOrLower { UInt32 version; return (Gestalt(gestaltSystemVersion,(SInt32 *) version) == noErr) (version 0x01050 ); } On 15-Nov-08, at 1:36 AM, Tom Fortmann wrote: Is there a core foundation function for querying the Mac OS X operating system name and version

Re: Notifying that a TextView's content has been changed?

2008-11-14 Thread chaitanya pandit
Try posting a NSTextDidChangeNotification with your text view as the object, after you do setString: On 15-Nov-08, at 1:23 AM, Jean-Nicolas Jolivet wrote: I have a TextView set up so its data is bound to my User Defaults controller so that its content is saved when I press a button... If

Re: Automatic file numbering ideas...

2008-11-23 Thread chaitanya pandit
I'm not sure if you guys want the prefix to be Picture etc. but i simply get a random number using rand(); and check if a file exists with that name. Heres a code snippet, + (NSString *)getUniqueNameForFile: (NSString *)aFilePath { // Initialise the return path NSString

NSTypesetter problem

2008-11-23 Thread chaitanya pandit
In my application i have an NSTextView with custom NSTextContainer and also a custom NSTypesetter, i have a problem with displaying HTML stuff in the textView. I copied and pasted the entire contents of an html page ( it was news.google.com to be precise), it displays it fine, but whenever i

Re: NSTypesetter problem

2008-11-25 Thread chaitanya pandit
setLineFragmentRect:forGlyphRange:usedRect:baselineOffset:] that's triggering the recursive layout. Aki On 2008/11/23, at 22:45, chaitanya pandit wrote: In my application i have an NSTextView with custom NSTextContainer and also a custom NSTypesetter, i have a problem with displaying HTML stuff in the textView. I copied and pasted

Re: NSTableView Drag-Drop re-ordering...

2008-11-26 Thread chaitanya pandit
To re-order the items in the tableView, you will have to implement a custom drag type. Say for example you name your custom drag type as @myDragType then 1] Register your table view to accept this drag type using registerForDraggedTypes: and passing an array containing @myDragType along

Re: NSTextView

2008-11-27 Thread chaitanya pandit
[[textView string]length]; Thats because NSTextView inherits from NSText which has string method. On 27-Nov-08, at 3:57 PM, Mahaboob wrote: Hi all, I need to check whether the NSTextView contains any data. For an NSTextField, [[txtName stringValue] length] should work. Is there any method like

Re: NSTrackingArea strange requirement

2008-11-29 Thread chaitanya pandit
Hi, I dunno if this is the right way to do it, but what if you Override mouseMoved: for the main view that contains all the subviews, and use a hitTest: to find the view over which the cursor is hovering and simply use [[NSCursor whateverCursor] set]; to change the cursor depending on the

Re: NSTypesetter problem

2008-12-04 Thread chaitanya pandit
provide the bt of the final infinite recursion ? Aki On 2008/11/25, at 1:19, chaitanya pandit wrote: Actually i'm doing nothing special in setLineFragmentRect... i simply note the fragment and call super's setLineFragmentRect... What i observed is that the a new typesetter gets initialized only

Re: NSOutline view contents getting grayed

2008-12-06 Thread chaitanya pandit
That is happening because the outline view is loosing it's it's first responder status. You can refuse to resign the first responder status by overriding - (BOOL)resignFirstResponder and returning NO HTH, Chaitanya On 06-Dec-08, at 4:43 PM, Arun wrote: Hi All, I am writing a coca

Re: NSOutline view contents getting grayed

2008-12-06 Thread chaitanya pandit
but still allows doubl-click and slection highlighting on the table view. I think what you'll have to do is use a custom cell for the table view. any idea? -Arun On Sat, Dec 6, 2008 at 5:39 PM, Graham Cox [EMAIL PROTECTED] wrote: On 6 Dec 2008, at 10:34 pm, chaitanya pandit wrote

Re: Weird behavior of mouse location when performing a drag

2008-12-10 Thread chaitanya pandit
Try this, NSPoint apoint = [self convertPoint:[sender draggedImageLocation] fromView:nil]; HTH, Chaitanya On 08-Dec-08, at 11:26 PM, Gustavo Pizano wrote: Hello all. Well Im performing a drag-ndrop between views of the same app, I implemented the - (NSDragOperation)draggingUpdated:(id

Re: Very odd issue when try to implement the drag and drop functions for NSOutlineview

2008-12-10 Thread chaitanya pandit
Hi, This was a reply that i posted recently for a similar question, i think you are missing step 2 To re-order the items in the tableView, you will have to implement a custom drag type. Say for example you name your custom drag type as @myDragType then 1] Register your table view to accept

NSTextContainer and proposedRect

2008-12-12 Thread chaitanya pandit
Hello, list, I'm finding it hard to understand the way the proposedRect should be handled in the NSTextContainer's lineFragmentRectForProposedRect:sweepDirection:movementDirection:remainingRect : method. The problem arises in certain cases where i get a weird proposedRect t. Usually the

  1   2   >