Re: Close/Minimize the app

2009-11-12 Thread Symadept
Hi, I have fixed my problem of miniaturizing the window. It was quite cool. NSApplication *application = [NSApplication sharedApplication]; NSWindow *keyWindow = [application keyWindow]; [keyWindow miniaturize:keyWindow]; My app has KeyWindow but not MainWindow, because my app's window is NSBord

Drag-Move the Transparent windowed app over the screen

2009-11-12 Thread Symadept
Hi, My app's window is a BorderLess Window because of which I will not have the Titlebar (Ref: RoundTransparentWindow of Apple examples). Because of which I can't drag and move over the screen. Any pointers to solve this. Regards symadept ___ Cocoa-de

Re: Mute/Unmute audio device

2009-11-12 Thread Symadept
Hi, I am using core audio to Set/Get the Audio device volume. With reference to the following code + (float)volume:(NSString*)deviceName isInput:(BOOL)isInput{ float b_vol; OSStatus err; UInt32 size; UInt32 channels[2]; float volume[2]; AudioDeviceID device = [AudioUtils DeviceIdFor:devic

Connecting up a drop down menu

2009-11-12 Thread Karen van Eck
Hi, Please could someone point me in the direction of a tutorial or something that shows how to bind up a drop down menu. I've been googling, reading, but am just getting more and more confused. I am looking for something very simple and clear, which assumes nothing, which will show me ho

Re: Drag-Move the Transparent windowed app over the screen

2009-11-12 Thread Dave Keck
Here's a clue: there's a method that you can override that rhymes with -houseTownTanGrooveRainbow. And it's documented! :D ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contac

Re: boundingRectWithSize:Option: and height constraint

2009-11-12 Thread Bill Cheeseman
On Nov 12, 2009, at 2:19 AM, Kyle Sluder wrote: > Which leads to the question: have you a demonstrated performance need > to make a shortcut here? If so, you probably shouldn't be using > NSStringDrawing anyway; it does a lot of temporary setup and takedown. The most recent documentation indica

Re: [iPhone] Authentication failing on device after changing registration data

2009-11-12 Thread Antonio Nunes
On 12 Nov 2009, at 08:43, Roland King wrote: > are you definitely receiving a challenge the *second* time you run the app? > It is possible that the server sends a cookie representing the login which > the phone has now cached and is sending along with the request > (automatically) which is fai

Re: -[NSString stringWithCString:encoding:] memory management question

2009-11-12 Thread Jeremy Pereira
On 11 Nov 2009, at 19:58, Hank Heijink (Mailinglists) wrote: > Hi all, > > I've run into a funny crash when using -[NSString > stringWithCString:encoding:]. The code in question runs in the iPhone > Simulator. I haven't found anything on the web about this, but I found out > some things by ex

Re: Connecting up a drop down menu

2009-11-12 Thread Symadept
Hi Karen, This is how I will do. http://mustafashaik.blogspot.com/2009/11/dropdown-box-popup-menu.html In this example refer to the awakeFromNib of DropDownButtonController and the handlers that I have registered during creation of the menu-items. Hope this is useful for you. Happy coding! Re

Re: Drag-Move the Transparent windowed app over the screen

2009-11-12 Thread Symadept
Hi Kiran, Excellent. Since my window is transparent and doing at runtime, I have to mention its properties during creation. - (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag { // Using NSBorderlessWindowMask

Re: -[NSString stringWithCString:encoding:] memory management question

2009-11-12 Thread Jens Miltner
Am 11.11.2009 um 20:58 schrieb Hank Heijink (Mailinglists): Hi all, I've run into a funny crash when using -[NSString stringWithCString:encoding:]. The code in question runs in the iPhone Simulator. I haven't found anything on the web about this, but I found out some things by experiment

NSXMLParser choking on single quotes

2009-11-12 Thread kentozier
Hi I'm using NSXMLParser to parse XML output from Microsoft Word and am finding that if a string contains a single quote, the parser is only giving me the part of the string from the single quote onward. For example given the following string: "The topic of Jim's discussion was on the yeti

Re: [MEET] CocoaHeads-NYC this Thursday, 11/12 (tonight)

2009-11-12 Thread Andy Lee
A reminder: On Nov 10, 2009, at 11:20 AM, Andy Lee wrote: Demitri Muna will talk about Cappuccino, a web UI framework that lets you build desktop-like apps using code that is eerily similar to Cocoa. Cappuccino uses Objective-J, an extension of JavaScript that looks and works like Objecti

Re: -[NSString stringWithCString:encoding:] memory management question

2009-11-12 Thread Hank Heijink (Mailinglists)
-initWithCString:encoding: should copy the bytes. You can verify that yourself with a small test: char buf[10+1] = "0123456789"; NSString *s = [[NSString alloc] initWithCString:buf encoding:NSASCIIStringEncoding]; NSLog(@"before %@", s); memset(buf, 'x', 10); NSLog(@"after %@

Re: -[NSString stringWithCString:encoding:] memory management question

2009-11-12 Thread Hank Heijink (Mailinglists)
On Nov 12, 2009, at 5:59 AM, Jeremy Pereira wrote: for (NSUInteger i = 0; i < nTags; i++) { unsigned long pcLength = 0; if (getLengthOfMetaData(fileHandle, metadataTags[i], 0, &pcLength) != 0) continue; Religious rant first: The above line is an abomination in my o

Re: -[NSString stringWithCString:encoding:] memory management question

2009-11-12 Thread Jeremy Pereira
On 12 Nov 2009, at 14:23, Hank Heijink (Mailinglists) wrote: > On Nov 12, 2009, at 5:59 AM, Jeremy Pereira wrote: > >>> for (NSUInteger i = 0; i < nTags; i++) { >>> unsigned long pcLength = 0; >>> if (getLengthOfMetaData(fileHandle, metadataTags[i], 0, >>> &pcLength)

re: iPhone CLLocation Accuracy?

2009-11-12 Thread Stephen Hoffman
on Wed, 11 Nov 2009 16:42:28 -0500 Chunk 1978 writes > how accurate is CLLocation's kCLLocationAccuracyBest? about a meter > or more? or is it hyper accurate as in centimeters? anyone know? FWIW, location determination by cell tower might be precise, but it is not necessarily accurate. iPho

Re: NSXMLParser choking on single quotes

2009-11-12 Thread Matt Neuburg
On Thu, 12 Nov 2009 12:08:20 + (UTC), kentoz...@comcast.net said: >I'm using NSXMLParser to parse XML output from Microsoft Word and am finding that if a string contains a single quote, the parser is only giving me the part of the string from the single quote onward. For example given the follo

Re: -[NSString stringWithCString:encoding:] memory management question

2009-11-12 Thread Kyle Sluder
On Nov 12, 2009, at 6:52 AM, Jeremy Pereira wrote: On 12 Nov 2009, at 14:23, Hank Heijink (Mailinglists) wrote: Why is that? The only difference between setValue:forKey: and setObject:forKey: is that the former uses the latter unless value is nil, in which case the key will be removed.

How do I get Lucida Grande italic into my application?

2009-11-12 Thread Eric Gorr
I need to be able to do this same thing and found this old thread and reply: http://lists.apple.com/archives/Cocoa-dev/2007/Jan/msg00577.html I assume the answer has not changed. Unfortunately, the link

[Q] copy operation and authorization

2009-11-12 Thread JongAm Park
Hello, I'm trying to copy a file from a desktop to a /Library/Application Supports/../Plugins directory. Because the directory requires to obtain system administrator's privilege I should be authorized. so, I wrote codes like this. - (void)awakeFromNib { [self authorize]; } - (void) appl

Re: Weird problem with Core Text

2009-11-12 Thread Aki Inoue
> Your comments do make sense. But the glitch lies in the code where it tries > to format a chunk of text with CTFrameSetter. I doubt it might have been > trapped into some infinite loop of memory allocation in the implementation > of > CTFrameSetterCreateFrame, and that's the reason why it's

Re: [Q] copy operation and authorization

2009-11-12 Thread Volker in Lists
Hi, I am using this and I guess it is the recommended way of doing. Works well: http://developer.apple.com/mac/library/samplecode/BetterAuthorizationSample/index.html Volker Am 12.11.2009 um 18:44 schrieb JongAm Park: Hello, I'm trying to copy a file from a desktop to a /Library/Applicati

Re: boundingRectWithSize:Option: and height constraint

2009-11-12 Thread Matt Neuburg
> Date: Thu, 12 Nov 2009 04:06:17 -0500 > From: Bill Cheeseman > Subject: Re: boundingRectWithSize:Option: and height constraint > > But I was not looking for efficiency gains, only ease of coding. The "coding" involved here is pretty much copy-and-paste from the existing examples - in other wor

Re: [Q] copy operation and authorization

2009-11-12 Thread Nick Zitzmann
On Nov 12, 2009, at 10:44 AM, JongAm Park wrote: > NSString *PlugInPath = [NSString stringWithString:@"/Library/Application > Support/Final Cut Pro System Support/Plugins/test3.valm"]; Apologies for being a little pedantic here, but calling +stringWithString: is almost never necessary and in

Re: [Q] copy operation and authorization

2009-11-12 Thread Sherm Pendley
On Thu, Nov 12, 2009 at 12:44 PM, JongAm Park wrote: > >     NSString *sourceFile = [NSString > stringWithFormat:@"%@/Desktop/test3.valm", NSHomeDirectory()]; Have you tried this? [[NSWorkspace sharedWorkspace] openFile:sourceFile]; Many apps register their plugin extensions as document typ

Re: [Q] copy operation and authorization

2009-11-12 Thread JongAm Park
I'm sorry, but the scenario doesn't apply to mine. Thank you. Sherm Pendley wrote: On Thu, Nov 12, 2009 at 12:44 PM, JongAm Park wrote: NSString *sourceFile = [NSString stringWithFormat:@"%@/Desktop/test3.valm", NSHomeDirectory()]; Have you tried this? [[NSWorkspace sharedW

Re: [Q] copy operation and authorization

2009-11-12 Thread JongAm Park
Nick Zitzmann wrote: On Nov 12, 2009, at 10:44 AM, JongAm Park wrote: NSString *PlugInPath = [NSString stringWithString:@"/Library/Application Support/Final Cut Pro System Support/Plugins/test3.valm"]; Apologies for being a little pedantic here, but calling +stringWithString: is a

Re: [Q] copy operation and authorization

2009-11-12 Thread JongAm Park
Hi, I already took a look at it. It is to use "factored" approach. Thank you. Volker in Lists wrote: Hi, I am using this and I guess it is the recommended way of doing. Works well: http://developer.apple.com/mac/library/samplecode/BetterAuthorizationSample/index.html Volker Am 12.11.20

Re: [Q] copy operation and authorization

2009-11-12 Thread Nick Zitzmann
On Nov 12, 2009, at 11:34 AM, JongAm Park wrote: >> You cannot escalate the privileges of a running task on Mac OS X. So if a >> running task does not have root privileges, then it never will. > > Then how? That's what AEWP() is for. Once you've pre-authorized, you pass your authorization ref

Re: How do I get Lucida Grande italic into my application?

2009-11-12 Thread Eric Gorr
Well, I experimented a bit and tried: const CGFloat kRotationForItalicText = -15.0; NSAffineTransform *italicTransform = [NSAffineTransform transform]; [italicTransform scaleBy:[NSFont systemFontSizeForControlSize:NSMiniControlSize]]; [italicTrans

Re: How do I get Lucida Grande italic into my application?

2009-11-12 Thread Jens Alfke
On Nov 12, 2009, at 9:39 AM, Eric Gorr wrote: Unfortunately, the link is no longer valid The file's been moved in the WebKit source tree since that URL was posted. Searching for 'FontMac.mm' i

Re: [Q] copy operation and authorization

2009-11-12 Thread JongAm Park
Thank you. I will try AuthorizationExecuteWithPrivileges(). JongAm Park Nick Zitzmann wrote: On Nov 12, 2009, at 11:34 AM, JongAm Park wrote: You cannot escalate the privileges of a running task on Mac OS X. So if a running task does not have root privileges, then it never will. T

Multiple variable rules in for() statement

2009-11-12 Thread Jonathon Kuo
I can't chance upon the right incantation for using both an existing variable and an inline new one in a for loop. I've boiled this down to a trivial show case, same results for both gcc 4.0.1 and 4.2.1: int i; . . . for (i=0, int m=0; i<5; i++) { . . . }; printf("Final value of i: %

Re: How do I get Lucida Grande italic into my application?

2009-11-12 Thread Eric Gorr
On Nov 12, 2009, at 2:21 PM, Jens Alfke wrote: > > On Nov 12, 2009, at 9:39 AM, Eric Gorr wrote: > >> Unfortunately, the link >> >> >> is no longer valid > > The file's been moved in the WebKit sou

Re: Multiple variable rules in for() statement

2009-11-12 Thread BJ Homer
I believe this is actually independent of being in a for loop. Your first line corresponds to code like this: int i; i=0, int m=0; Which is syntactically incorrect. Your second example corresponds to this: int i; int m=0, i; Which is an attempt to re-declare i. So you're correct; you can't h

Re: Multiple variable rules in for() statement

2009-11-12 Thread Greg Parker
On Nov 12, 2009, at 11:29 AM, Jonathon Kuo wrote: > I can't chance upon the right incantation for using both an existing variable > and an inline new one in a for loop. I've boiled this down to a trivial show > case, same results for both gcc 4.0.1 and 4.2.1: > > int i; > . . . > for (i=0, i

Re: [Q] copy operation and authorization

2009-11-12 Thread JongAm Park
Thank you all. It works now. What is interesting was that it didn't require to use PreAuthoriazation flag when invoking "cp". I think the "Factored Application" case in the document was about an external program which are not Unix commands but something else. Thank you again. JongAm Park

Re: [Q] copy operation and authorization

2009-11-12 Thread Nick Zitzmann
On Nov 12, 2009, at 1:17 PM, JongAm Park wrote: > What is interesting was that it didn't require to use PreAuthoriazation flag > when invoking "cp". You don't need to pre-authorize if you're only going to invoke an authorization once; you only need to do that if there is a chance that you need

Re: How do I get Lucida Grande italic into my application?

2009-11-12 Thread Jens Alfke
On Nov 12, 2009, at 11:37 AM, Eric Gorr wrote: CGAffineTransformMake(1, 0, -tanf(SYNTHETIC_OBLIQUE_ANGLE * acosf(0) / 90), 1, 0, 0)); My matrix math is a bit rusty...how would I turn that into a series of method calls to NSAffineTransform? Looks like those parameters are the six values

controlTextDidEndEditing and buttons...

2009-11-12 Thread Carlo Caione
Hi, How can I send a controlTextDidEndEditing: to a NSTextField when I click on another button (without using tab or enter)? Thanks -- CC___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comment

Array of dictionaries containing NSColor in NSUserDefaults

2009-11-12 Thread Martin Hewitson
Dear list, The hardest part of this problem may be explaining it, but here goes. I want to store an array of dictionaries in NSUserDefaults. In each dictionary I have a string and a color. The color is stored as data using NSArchiver. So I build an array of these dictionaries, then put that arr

Re: controlTextDidEndEditing and buttons...

2009-11-12 Thread Kyle Sluder
On Nov 12, 2009, at 12:52 PM, Carlo Caione wrote: How can I send a controlTextDidEndEditing: to a NSTextField when I click on another button (without using tab or enter)? You want to use NSEditorRegistration. --Kyle Sluder ___ Cocoa-dev mailing

Re: [Q] copy operation and authorization

2009-11-12 Thread Kyle Sluder
On Thu, Nov 12, 2009 at 9:44 AM, JongAm Park wrote: > Should I use AuthorizationExecuteWithPrivileges() and invoke an external > command like "cp"? No. Do not do this. Follow the pattern of BetterAuthorizationSample: http://developer.apple.com/mac/library/samplecode/BetterAuthorizationSample/li

Re: CGImageRef printing issue

2009-11-12 Thread Mirko Viviani
On 12/ago/2009, at 21.30, David Duncan wrote: >> From my experience on Windows, DPIHeight and DPIWidth are properties of the >> display device the image is drawn on, and not properties of the image >> itself. > > They are properties of both. In the case of printing, you are using a fixed > grid

Re: CGImageRef printing issue

2009-11-12 Thread David Duncan
On Nov 12, 2009, at 2:26 PM, Mirko Viviani wrote: > On 12/ago/2009, at 21.30, David Duncan wrote: > >>> From my experience on Windows, DPIHeight and DPIWidth are properties of the >>> display device the image is drawn on, and not properties of the image >>> itself. >> >> They are properties of b

Re: CGImageRef printing issue

2009-11-12 Thread Kyle Sluder
On Thu, Nov 12, 2009 at 2:26 PM, Mirko Viviani wrote: > Do you mean that there is no way to print an image using a grid of 300 PPI > with Cocoa/Quartz? > If not, why? Alternatives? Resolution independence. Your physical screen may have 96 pixels per inch, but the system exposes it as 72 points

Re: CGImageRef printing issue

2009-11-12 Thread Shawn Erickson
On Thu, Nov 12, 2009 at 2:26 PM, Mirko Viviani wrote: > Do you mean that there is no way to print an image using a grid of 300 PPI > with Cocoa/Quartz? > If not, why? Alternatives?

Re: Multiple variable rules in for() statement

2009-11-12 Thread Jonathon Kuo
On Nov 12, 2009, at 12:14 PM, Greg Parker wrote: On Nov 12, 2009, at 11:29 AM, Jonathon Kuo wrote: I can't chance upon the right incantation for using both an existing variable and an inline new one in a for loop. I've boiled this down to a trivial show case, same results for both gcc 4.0.1

Possible hardware-platform-dependent bug in NSTextView?!?

2009-11-12 Thread Jay Reynolds Freeman
I *think* this is the right group, I would be glad to take it elsewhere if not. I have reports from users of a problem which seems to be dependent on the Mac hardware platform my code is running on. The bug unfortunately does not seem to occur on any Macintosh that I happen to own, so it is very h

Re: Possible hardware-platform-dependent bug in NSTextView?!?

2009-11-12 Thread Kyle Sluder
On Thu, Nov 12, 2009 at 3:31 PM, Jay Reynolds Freeman wrote: > The bug occurs when a user is typing into an instance of a > subclass of NSTextView that I have created.  (Side issue:  I > do believe I had good reason to subclass rather than to use a > delegate, details on request.)  On some platfor

Re: How do I get Lucida Grande italic into my application?

2009-11-12 Thread Graham Cox
On 13/11/2009, at 6:37 AM, Eric Gorr wrote: > My matrix math is a bit rusty...how would I turn that into a series of method > calls to NSAffineTransform? For a skew transform you can't use a series of method calls, you have to fill in the transform struct yourself and use -setTransformStruct:

Re: Array of dictionaries containing NSColor in NSUserDefaults

2009-11-12 Thread Graham Cox
On 13/11/2009, at 8:18 AM, Martin Hewitson wrote: > Has anyone tried something like this, or can anyone see what I'm doing wrong? I'm a bit mystified by your data structure here. Why do you use a separate dictionary for each key/value pair (name/colour pair)? Why not just use one dictionary f

Re: Array of dictionaries containing NSColor in NSUserDefaults

2009-11-12 Thread Matt Mashyna
Are you calling setObject and sync with NSUserdefaults at some point? Matt Sent from my iPhone On Nov 12, 2009, at 4:18 PM, Martin Hewitson wrote: Dear list, The hardest part of this problem may be explaining it, but here goes. I want to store an array of dictionaries in NSUserDefaul

Re: Possible hardware-platform-dependent bug in NSTextView?!?

2009-11-12 Thread Jay Reynolds Freeman
The instance of my subclass of NSTextView in question is narrow from top to bottom; there is only room for one line. When the unexpected scrolling happens, the place where the user was typing -- where the cursor and insert point are -- scrolls out of sight off the bottom of the view. This is most

Auto-scrolling view

2009-11-12 Thread Symadept
How to design Auto-scrolling view. Any pointers are highly appreciable. Regards symadept ___ 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-adm

can't read NSMenuItem titles from NSMenu's below first NSMenu

2009-11-12 Thread SRD
I have an NSPopUpButton of type pulldown with the following structure: NSMenu |- NSMenu ---> item-1 // can't read value from sender |- item-2 // can read sender |- item-3 // can read sender When selecting anything off th

All Address Book person unique IDs are the same [solved]

2009-11-12 Thread Greg Hoover
I extended NSManagedObject to provide a uniqueId accessor similar to that of ABRecord. Turns out that this messed with the uniqueId accessor of ABRecord. The docs don't say that ABRecord inherits from NSManagedObject but somewhere they do I guess (it seems reasonable that they would)...lesson

Re: Auto-scrolling view

2009-11-12 Thread Graham Cox
On 13/11/2009, at 1:25 PM, Symadept wrote: > How to design Auto-scrolling view. Any pointers are highly appreciable. [NSView autoscroll:] If that isn't appropriate, I refer you to my earlier reply to another message you posted: http://catb.org/~esr/faqs/smart-questions.html --Graham _

Re: Array of dictionaries containing NSColor in NSUserDefaults

2009-11-12 Thread Martin Hewitson
On Nov 13, 2009, at 1:39 AM, Graham Cox wrote: > > On 13/11/2009, at 8:18 AM, Martin Hewitson wrote: > >> Has anyone tried something like this, or can anyone see what I'm doing wrong? > > > I'm a bit mystified by your data structure here. Why do you use a separate > dictionary for each key/v

Re: can't read NSMenuItem titles from NSMenu's below first NSMenu

2009-11-12 Thread Graham Cox
On 13/11/2009, at 2:09 PM, SRD wrote: > When selecting anything off the first menu (item-2 or item-3), the > value of 'sender' prints fine and I can compare it using the code > below. But if I select the first item which is an NSMenu and leads to > another NSMenu with it's item (item-1), then the

Re: Array of dictionaries containing NSColor in NSUserDefaults

2009-11-12 Thread Graham Cox
On 13/11/2009, at 4:41 PM, Martin Hewitson wrote: > The point is to store an array of 'items' with a 'name' together with a > 'color'. And later there may be more properties of an 'item'. This really calls for your own 'item' class that holds all the various properties that you have in mind.

Re: Array of dictionaries containing NSColor in NSUserDefaults

2009-11-12 Thread Martin Hewitson
On Nov 13, 2009, at 6:58 AM, Graham Cox wrote: > > On 13/11/2009, at 4:41 PM, Martin Hewitson wrote: > >> The point is to store an array of 'items' with a 'name' together with a >> 'color'. And later there may be more properties of an 'item'. > > > This really calls for your own 'item' clas

Re: [Q] copy operation and authorization

2009-11-12 Thread Jerry Krinock
On 2009 Nov 12, at 14:24, Kyle Sluder wrote: No. Do not do this. Follow the pattern of BetterAuthorizationSample: http://developer.apple.com/mac/library/samplecode/BetterAuthorizationSample/listing4.html Yes, what Kyle says is true. AEWP is not recommended. Now, thought, the *correct* way

How to update table while in a method

2009-11-12 Thread Ashley Perrien
I have an application that has a table of various internet resources and information on them. What I would like to be able to do is: for (netResource *resource in anArrayOfResources) { [resource updateInfo]; [resultsTable reloadData]; } But it seems that the table refuses to redr

Re: How to update table while in a method

2009-11-12 Thread Graham Cox
On 13/11/2009, at 6:20 PM, Ashley Perrien wrote: > But it seems that the table refuses to redraw until after everything has been > updated. So when I do this process, I get the spinning cursor for a few > second (looks like it hung) and then the table updates. I'd prefer the table > to update