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 a

"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 sender, it returns nil. Also, the point that "dragge

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

CFAttributedString and NSDATA

2010-06-03 Thread Chaitanya Pandit
p. Thanks, 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 Subscrip

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. Wha

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 questi

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: 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

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: 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

[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

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? Tha

Re: How to edit/resize embedded graphics and images in a NSTextView ?

2010-05-12 Thread Chaitanya Pandit
NSTextView by default won't allow you to resize the media objects, these media objects are actually NSTextAttachments displayed in NSTextAttachmentCells. Thanks, Chaitanya On May 12, 2010, at 10:27 PM, Anders Sommer Lassen wrote: > Hi, > > I want to embed graphics and images in a NSTextView,

CAScrollLayer scrollToPoint: suppress animation

2010-05-11 Thread Chaitanya Pandit
Is there any way to make CAScrollLayer to scroll to a point without animating? I tried this just before i call scrollToPoint, but didn't work [CATransaction begin]; [CATransaction setValue: (id) kCFBooleanTrue forKey: kCATransactionDisableActions]; [CATransaction commit]; Any idea? Thanks, Ch

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 wor

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

2010-05-04 Thread Chaitanya Pandit
else [newObject setValue:value forKey:key]; } } [inManager associateSourceInstance:inSourceInstance withDestinationInstance:newObject forEntit

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

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 pr

Re: Details and the concepts related to the Nib Window

2010-03-23 Thread Chaitanya Pandit
ckground stuff happening in the background. > You may 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 I

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 b

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 clo

Core Data Migration

2009-12-20 Thread Chaitanya Pandit
model has been changed I'd really appreciate any help. 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

Re: Tiger vs Leopard Printing

2009-01-08 Thread chaitanya pandit
Am not sure but have a look at : NSPrintPanelAccessorizing Protocol Reference -Chaitanya On 08-Jan-09, at 6:55 AM, David Blanton wrote: I build my app with the MACOSX10.4u.sdk. When the following is executed: [[NSPrintOperation printOperationWithView:catalog] runOperationModalForWindow:mai

Re: NSOutlineView

2008-12-29 Thread chaitanya pandit
Hi, Mahaboob, Did you try calling [outlineView reloadData] in ur launch method? -Chaitanya On 30-Dec-08, at 10:33 AM, Mahaboob wrote: My application uses an NSPopupButton and NSOutlineView. PopupButton shows all the table names in the database and the outlineView displays the data in the cor

Re: getObjects:andKeys

2008-12-19 Thread chaitanya pandit
Hehe, i know, but he just wanted an example as to what can be done with getObjects:andKeys. This was focused on using the getObjects... method rather than to create a copy of the dict. On 20-Dec-08, at 10:56 AM, Michael Ash wrote: On Sat, Dec 20, 2008 at 12:20 AM, chaitanya pandit wrote

Re: getObjects:andKeys

2008-12-19 Thread chaitanya pandit
Jordon, this can be used to create copies of a dictionary, you get the keys and values array with getObjects:andKeys on an existing dictionary and iterate through the keys array and setting the same keys and values for a mutable dict. On 17-Dec-08, at 7:06 PM, Jordon Hirshon wrote: Can

Re: Text layout responsibility

2008-12-12 Thread chaitanya pandit
Try changing the container size once the layout is complete, you can do this by using the delegate method: - (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer atEnd:(BOOL)layoutFinishedFlag and checking the layoutFinishedF

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 pr

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 accep

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: NSOutline view contents getting grayed

2008-12-06 Thread chaitanya pandit
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 wrot

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 applicat

Re: NSTypesetter problem

2008-12-04 Thread chaitanya pandit
ion at all. Can you 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 ty

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: 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 lik

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" alon

Re: NSTypesetter problem

2008-11-25 Thread chaitanya pandit
5 -[TTypesetter 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 c

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: 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 *pa

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 I

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 i

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#/ /apple_ref/doc/u

[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 A

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 AudioHardwa

Re: Detect microphone

2008-11-10 Thread chaitanya pandit
, Kyle Sluder wrote: 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

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 micPresent

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 ed

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 hav

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,

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 wi

Re: alpha value from NSBitmapImageRep

2008-10-28 Thread chaitanya pandit
csContext restoreGraphicsState]; 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 righ

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 t

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

2008-10-27 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 "on

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

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 loo

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 loo

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 w

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 sim

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 content

Re: NSTableView and drag and drop

2008-10-11 Thread chaitanya pandit
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

Re: NSTableView and drag and drop

2008-10-10 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 t

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: 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 NSSaveAsOp

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: 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 th

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 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 relat

Re: Direct use of NSScroller?

2008-10-02 Thread chaitanya pandit
How about using a NSSlider? On 02-Oct-08, at 7:43 AM, James Walker 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 that is not embedded in an NSScrollView. I guess I could shrink down the NSScrollView so that y

Re: Fastest color detection in image?

2008-09-26 Thread chaitanya pandit
Well, there are 2 ways you can do it first would be to use: NSReadPixel(apoint); This method requires you to lock focus on the image before u call it. You would have to iterate through every point in the image and get it's color. But i found that this is a bit slow, to make it a bit faster you c

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 controlle

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 NS

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 ofSubviewAt:(NSInt

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 ;

Re: Creating alias programatically

2008-09-23 Thread chaitanya pandit
On 24-Sep-08, at 2:22 AM, Nick Zitzmann wrote: On Sep 23, 2008, at 2:48 PM, chaitanya pandit wrote: I tried using: OSErr FSNewAliasFromPath ( const char *fromFilePath, const char *targetPath, OptionBits flags, AliasHandle *inAlias, Boolean *isDirectory ); But i don't quite ge

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 fil

Re: Creating alias programatically

2008-09-23 Thread chaitanya pandit
quot; at "Users/ 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

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 creati

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 programati

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 {

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 NSFetc

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 fi

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 os

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 documentV

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

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 you

Increasing NSTextView's height

2008-09-01 Thread chaitanya pandit
In my application, i want to increase the height of the NSTextView in order to make it's subview's visible. The subview's exceed further down the area occupied by the text. But even if i change the textView's frame by increasing it's height so that it occupies the bottom most subview, i don'

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: NSMenuItem - setHidden

2008-08-22 Thread chaitanya pandit
class) [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 t

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: Application crashing ( Maybe I'm over releasing object? )

2008-08-19 Thread chaitanya pandit
Try using NSZombieEnabled to trap over released objects, Have a look at the following documents for using NSZombieEnabled http://developer.apple.com/technotes/tn2004/tn2124.html Also, http://cocoadev.com/index.pl?NSZombieEnabled -Chaitanya On 20-Aug-08, at 12:40 AM, Nicolas Goles wrote: Hey

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

NSATSTypesetter Line computation problem

2008-08-19 Thread chaitanya pandit
In my application i use a custom text container to lay text around a hole, the problem occurs when i have two holes side by side. In this case the line would be broken down in to three line fragments. The problem occurs when the rightmost fragment has bigger font than the ones on the left.

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 la

Re: NSTypesetter layoutParagraphAtPoint:

2008-08-13 Thread chaitanya pandit
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 p

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 *)fieldEditor:(BOOL)createWhen

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 p

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 NSTextAttachmentCel

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 yo

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 = [[[NSTextAttac

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 SKIndexSetDoc

  1   2   >