NSButton setStringValue

2008-02-28 Thread ali alavi

I am trying to change the title of a push button after each click (eg: to swap 
between Play and Pause)

I am using this code:

if(m_isPlaying)
{
[myButton setStringValue:@Play];
m_isPlaying = 0; 
}

else
{
[myButton setStringValue:@Pause];
m_isPlaying = 1; 
}

None of above setStringValue works and the default title of the button remain 
unchanged. 
Any help would be appreciated?

_

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSButton setStringValue

2008-02-28 Thread Apparao Mulpuri
You can use setAlternativeTitle method

-  Apparao.

On 2/28/08, ali alavi [EMAIL PROTECTED] wrote:

 I am trying to change the title of a push button after each click (eg: to 
 swap between Play and Pause)

 I am using this code:

 if(m_isPlaying)
 {
[myButton setStringValue:@Play];
m_isPlaying = 0;
 }

 else
 {
[myButton setStringValue:@Pause];
m_isPlaying = 1;
 }

 None of above setStringValue works and the default title of the button remain 
 unchanged.
 Any help would be appreciated?

 _

 ___

 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://lists.apple.com/mailman/options/cocoa-dev/apparao.forums%40gmail.com

 This email sent to [EMAIL PROTECTED]

___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSButton setStringValue

2008-02-28 Thread Ron Fleckner


On 28/02/2008, at 8:15 PM, ali alavi wrote:



I am trying to change the title of a push button after each click  
(eg: to swap between Play and Pause)


I am using this code:

if(m_isPlaying)
{
[myButton setStringValue:@Play];
m_isPlaying = 0;
}

else
{
[myButton setStringValue:@Pause];
m_isPlaying = 1;
}

None of above setStringValue works and the default title of the  
button remain unchanged.

Any help would be appreciated?



You should use [myButton setTitle:@Play]; as documented in NSButton  
Class Reference.  -setStringValue: belongs to NSControl, I think.


Ron
___

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://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]