In my app, I have a TextView displayed, and I want to apply a font to the current selection in the TextView.

This seemed sometimes to work, and sometimes not. Eventually I noticed that as the FontButton dialog has an editable SpinButton to choose the font size, it is possible, intentionally or accidentally to select part or all of the numeric text in that box.

If you do that, the TextView loses its current selection, and consequently in the onFontChanged handler, things go awry since there is no longer a selection ;=(

So to make the thing work reliably, you have to add an onClicked handler to the FontButton, and have that tell the object using the TextView to make a note of the selection before the font dialog comes up.

Who is online

Users browsing this forum: No registered users and 8 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum