Re: Automatically replacing part of text in a text label

2009-03-17 Thread Peter Zegelin
Thanks Michael, That works great. I changed the name of the variable as well: [warrantyTextView readRTFDFromFile:[[NSBundle mainBundle] pathForResource:@"LicenseAgreement" ofType:@"rtf"]]; NSMutableString *warranty = [[warrantyTextView textStorage] mutableString]; [war

Re: Automatically replacing part of text in a text label

2009-03-17 Thread Michael Ash
On Tue, Mar 17, 2009 at 10:41 PM, Peter Zegelin wrote: > In the same vein I have two other bits where I would like to automatically > replace text. The first is my 'Warranty Panel'. I am currently loading it > into an NSTextView like so: > > [warrantyTextField readRTFDFromFile:[[NSBundle mainBundl

Re: Automatically replacing part of text in a text label

2009-03-17 Thread Peter Zegelin
On 16/03/2009, at 5:20 PM, Peter Zegelin wrote: OK - thanks everyone. Just as I was about to wire things up in IB I realised that a subclass of NSTextField would be the best way. Turns out its a one liner in awakeFromNib. - (void)awakeFromNib { [self setStringValue:[[self string

Re: Automatically replacing part of text in a text label

2009-03-17 Thread Rich Collyer
You might try just getting the name as an NSString with: NSString applicationName = [[[NSBundle mainBundle] infoDictionary] objectForKey: CFBundleExecutable]; Than populate the dialog with that string (using the technique shown by Mark. +++ Rich Collyer - Senior Softwa

Re: Automatically replacing part of text in a text label

2009-03-17 Thread Ricky Sharp
On Mar 17, 2009, at 3:33 PM, Peter Ammon wrote: On Mar 15, 2009, at 11:20 PM, Peter Zegelin wrote: I have some text labels in a registration dialog that contain the application name eg "xxx Demonstration" "Thank you for purchasing xxx" and so on. I would like this registration dialog to

Re: Automatically replacing part of text in a text label

2009-03-17 Thread Peter Ammon
On Mar 15, 2009, at 11:20 PM, Peter Zegelin wrote: I have some text labels in a registration dialog that contain the application name eg "xxx Demonstration" "Thank you for purchasing xxx" and so on. I would like this registration dialog to be general enough that I can use it in multiple

Re: Automatically replacing part of text in a text label

2009-03-17 Thread Michael Ash
On Mon, Mar 16, 2009 at 2:20 AM, Peter Zegelin wrote: > I have some text labels in a registration dialog that contain the > application name eg > > "xxx Demonstration" > "Thank you for purchasing xxx" > > and so on. > > I would like this registration dialog to be general enough that I can use it >

Re: Automatically replacing part of text in a text label

2009-03-16 Thread Peter Zegelin
On 16/03/2009, at 6:52 PM, Mark Ritchie wrote: On 16-Mar-09, at 2:20 AM, Peter Zegelin wrote: I would like this registration dialog to be general enough that I can use it in multiple applications. Is there a simple way to replace the xxx with the actual application name at runtime? At the

Re: Automatically replacing part of text in a text label

2009-03-16 Thread Mark Ritchie
On 16-Mar-09, at 2:20 AM, Peter Zegelin wrote: I would like this registration dialog to be general enough that I can use it in multiple applications. Is there a simple way to replace the xxx with the actual application name at runtime? At the moment I'm thinking I'll have to wire every label

Automatically replacing part of text in a text label

2009-03-15 Thread Peter Zegelin
I have some text labels in a registration dialog that contain the application name eg "xxx Demonstration" "Thank you for purchasing xxx" and so on. I would like this registration dialog to be general enough that I can use it in multiple applications. Is there a simple way to replace the x