Invoke a callback when a user selects some text.