Add Red Text in Tooptip?
Currently this feature is not available through the Python API, only for operators implemented in C.

The operator in your screenshot select_ungrouped() is implemented in source\blender\editors\mesh\editmesh_select.c

Operators can use a poll function to check whether they can be executed in the current context. This functionality for select_ungrouped() is implemented in edbm_select_ungrouped_poll(). In this function the message in red is set through:

CTX_wm_operator_poll_msg_set(C, "Must be in vertex selection mode");




If a message is set through this function and the operator is disabled because poll returns false, it will be displayed beneath the operator's description as a tooltip in the UI. This behavior is implemented in source\blender\editors\interface\interface_region_tooltip.c

The documentation mentions this feature in the Gotchas page.


  Blender does have the functionality for poll functions to describe why they fail, but its currently not used much, if you’re interested to help improve our API feel free to add calls to CTX_wm_operator_poll_msg_set where its not obvious why poll fails.