# Change Button Label on the Fly?

**URL:** https://forum.highend3d.com/t/change-button-label-on-the-fly/5035
**Category:** Maya
**Tags:** mel
**Created:** [August 14, 2003, 12:36am UTC](https://forum.highend3d.com/t/change-button-label-on-the-fly/5035 "2003-08-14T00:36:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![inspleak](https://forum.highend3d.com/user_avatar/forum.highend3d.com/inspleak/32/54722_2.png) [@inspleak](https://forum.highend3d.com/u/inspleak)
#### Post date: [August 14, 2003, 12:36am UTC](https://forum.highend3d.com/t/change-button-label-on-the-fly/5035/1 "2003-08-14T00:36:00Z")

</div>

Hey guys... is there a good way to change a button label (or text lable or whatever) when that button is pressed?

I tried this:  
button  
 -label "Not Pressed"  
 -c "button -e -label "Pressed" myButton;"  
 myButton;

but of course it gets confused with the all of the quotes (")  
sooooo... is there a way to do this without pre-defining a string var with the proper text in it?

thanks!

-jake

---

<div class="post-metadata">

### Author: ![dbiggs](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/d/eb9ed0/32.png) [@dbiggs](https://forum.highend3d.com/u/dbiggs)
#### Post date: [August 14, 2003, 1:52am UTC](https://forum.highend3d.com/t/change-button-label-on-the-fly/5035/2 "2003-08-14T01:52:04Z")

</div>

try this  
button -label "oldName" -c("button -e -l "NewName" myButton") myButton;

---

<div class="post-metadata">

### Author: ![joojaa](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@joojaa](https://forum.highend3d.com/u/joojaa)
#### Post date: [August 14, 2003, 7:22am UTC](https://forum.highend3d.com/t/change-button-label-on-the-fly/5035/3 "2003-08-14T07:22:08Z")

</div>

yes escaping fun aint it... But one might need to be carefull with that since it gets realy confusing to escape something to the sytem command that needs to be escaped itself and that espaed for perl. gets very confusing to read.

This is the readon why
