Track the currently selected child Rectangle using a property in the parent. Have the onClicked handler reset the bold flag of the selected rectangle, and then update the tracking property.
Given that font.bold is boolean, txt_bold should be boolean rather than a string. Instead of having properties that only serve to provide an [incorrectly typed] external interface, consider using aliases.
↧