I must have 3.0 also.. there is no WinDrawTruncChars on my system. So,
from reading the other
postings on how to write your own, I wrote one that works for me. This
should save you about 45
seconds (120 if you have to look up the API like I did).
void
TrimString(CharPtr Str, Int Pixels)
{
Int sWid, sLen;
Boolean fit;
sWid = Pixels - 6;
sLen = StrLen(Str);
FntCharsInWidth(Str, &sWid, &sLen, &fit);
if (!fit) {
Str[sLen] = 0;
StrCat(Str, "...");
}
}
- Re: Working Code for String Truncate: For OS 3.0 Oguri, Joe
- Re: Working Code for String Truncate: For OS 3.0 Brian O'Grady
- Re: Working Code for String Truncate: For OS 3.0 Ken Krugler
