[SOLVED] change the icon of a button when I click on it?

Hi guys!.

How can I change the icon of a button(BoolProperty) when I click on it?
Thanks.

HI, try that . . .

See here for more code : https://blenderartists.org/forum/showthread.php?348496-Addon-Wazou-s-Pie-Menus/page3

def view3d_lockCamera(self, context):
    layout = self.layout
    if context.space_data.lock_camera:
        layout.prop(context.space_data, "lock_camera", icon = "LOCKED") # icon = "CAMERA_DATA" if you prefer a camera icon
    else:
        layout.prop(context.space_data, "lock_camera", icon = "UNLOCKED")

Thanks!! :smiley: work fine!.