I'm trying to do something that seems like it ought to be easy, but I've found no (obvious) simple solution. As a program is running, interim results and comments are added to a string (call it StringCum), that - at the discretion of the user - may be shown via a call to MessageDialog[StringCum,...]. So far, so good.
What I'd like to do, however, is periodically highlight certain text. For example, if a special event, Event1, occurs, I'd like that portion of the cumulative string to be highlighted (say, as FontColor->Red). The command, MessageDialog[ StringCum <> Style["Event1 has occurred", FontColor -> Red]] highlights the text but (1) print "<>" as though it was itself a string, and (2) does not alloow me to concatenate any further strings at some later point; i.e., I'd like to define StringCum =StringCum <>Style["Event1 has occurred", FontColor -> Red]], I get an error. And if I try defining a string: StringCum =StringCum <>ToString[Style["Event1 has occurred", FontColor -> Red]]], everything works except that the color highlighting disappears.
In short, I'd like to highlight selected parts of a string that is being displayed via MessageDialog,
Anything anyone can suggest?
Thanks! (first time posting here...I've done a search on what I thought were similar issues, but could not find a match).