Getting the 'FormattedWidth' of a Tab Button |
|
Posted 2/8/2006 by Ken Ray to the MetaCard Liston mouseUp put tabFormattedWidth(long id of btn 1) into tWidth set the width of btn 1 to tWidth end mouseUp function tabFormattedWidth pBtnDesc put the text of pBtnDesc into tTabs lock screen put 0 into tWidth put the number of lines of tTabs into tNum put the label of pBtnDesc into tOrigLabel repeat with x = 1 to tNum set the label of pBtnDesc to (line x of tTabs) put the formattedWidth of pBtnDesc into tFW add tFW to tWidth end repeat put tWidth + (18* tNum) into tWidth set the label of pBtnDesc to tOrigLabel unlock screen return tWidth end tabFormattedWidth