Make a UI Element Disabled When In Edit Mode

Hello,

I’m trying to make a test script and I want to disable a button if Blender is currently in edit mode.

row.operator(“btn_cmd_here”, text=“Button Name”, icon=“btn_icon_here”)

Does anybody know how to do this?

Thanks.

Conditional should be enough, no?

if context.mode != 'EDIT_MESH':
    row.operator("btn_cmd_here", text="Button Name", icon="btn_icon_here")