GameObject go = GameObject.Find("btnAnswer4");
UILabel l = go.GetComponentInChildren<UILabel>();
l.text = "Thsi is a much much longer button";
UISlicedSprite bg = go.GetComponentInChildren<UISlicedSprite>();
Transform backgroundTrans = bg.transform;
Vector3 mSize = l.transform.localScale;
Transform textTrans = l.transform;
Vector3 offset = textTrans.localPosition;
Vector3 textScale = textTrans.localScale;
// Calculate the dimensions of the printed text
mSize = l.relativeSize;
// Scale by the transform and adjust by the padding offset
mSize.x *= textScale.x;
mSize.y *= textScale.y;
mSize.x += bg.border.x + bg.border.z + (offset.x - bg.border.x) * 2f;
mSize.y += bg.border.y + bg.border.w + (-offset.y - bg.border.y) * 2f;
mSize.z = 1f;
backgroundTrans.localScale = mSize;
NGUITools.AddWidgetCollider(go);
//bg.transform.localScale.Set(lwCharPixSize.x, lwCharPixSize.y, bg.transform.localScale.z);
NGUITools.AddWidgetCollider(p);