Hi, do you know how can I add a tooltip to an operator button?
I have a dictionary with keys id, name, description.
This dictionary structure is placed in a list to compose the buttons.
for i in guiList:
op = col.operator("myoperator", text=i["name"])
The code works fine, obviously the text parameter exists, but is there any parameter for tooltips?
What I would like to do additionally is to offer some tooltips when the user hovers above the button.
With an operator defined as (irrelevant parts omitted):
class WM_OT_tooltip_test(bpy.types.Operator):
arg: bpy.props.StringProperty()
@classmethod
def description(cls, context, properties):
return "Arg is: " + properties.arg
The following button would have a tooltip that says “Arg is: FOO”.
layout.operator('wm.tooltip_test').arg = 'FOO'
This is mainly intended for cases when multiple similar but distinct operations are implemented for technical reasons as one operator with a mode switch parameter.