Change Text, Button, and Icon on Button Click With Python in Blender How can the text, icon, and a button state (toggle high or low) be changed when a button is clicked? Just for understanding the mechanics, I wanted to know the most verbose and least verbose way to change text on a button, text on a label, an icon, and a button state (toggle up/ down) from a single button click from a button that contains the said text, icon, toggle state, and visually associated label.

            import bpy
            from bpy.props import *

            def initSceneProperties(scn):
                stin = bpy.types.Scene

                stin.MyString1 = BoolProperty(
                    name = "String")
                scn['MyString1'] = "Test 1"

                stin.MyString2 = BoolProperty(
                    name = "String")
                scn['MyString2'] = "Test 2"
                return

            initSceneProperties(bpy.context.scene)

            #   Layout panel
            class LayoutPanel(bpy.types.Panel):
                bl_label = "Hide Tools"
                bl_space_type = "VIEW_3D"
                bl_region_type = "TOOL_PROPS"

                def draw(self, context):
                    layout = self.layout
                    scn = context.scene

                    layout.label("TEST")
            # First String   
                    layout.prop(scn, 'MyString1', text="")
                    row = layout.row(align=True)
                    row.operator("my.button", text="1", icon="CANCEL", toggle=True)

            # Second String        
                    layout.prop(scn, 'MyString2', text="")
                    row = layout.row(align=True)
                    row.operator("my.button", text="2", icon="CANCEL", toggle=True)

            #   Button
            class OBJECT_OT_Button(bpy.types.Operator):
                bl_idname = "my.button"
                bl_label = "Button"

                def execute(self, context):
                    scn = context.scene
                    layout = self.layout
                    icon = LayoutPanel.draw

                    if scn.MyString1 == "MyString2" | row.operator(toggle=True):
                        label = "TEST2"
                        icon.row.operator[icon] == "ERROR"
                        icon.row.operator[text] == "A"
                        icon.row.operator[toggle] = True
                    else:    
                        scn.MyString1 == "MyString1"
                        label = "TEST1"
                        icon.row.operator[icon] == "CANCEL"
                        icon.row.operator[text] == "B"
                        icon.row.operator[toggle] = False
                    return{'FINISHED'} 

            bpy.utils.register_module(__name__)
I got it batFINGER

Thanks! Mine was verbose indeed, but alas not close.

import bpy
from bpy.props import *

def initSceneProperties(scn):
    bpy.types.Scene.MyBool = BoolProperty(
        name = "Boolean", 
        description = "None")
    scn['MyBool'] = True
    return

initSceneProperties(bpy.context.scene)

class UIPanel(bpy.types.Panel):
    bl_label = "Property panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"

    def draw(self, context):
        layout = self.layout
        scn = context.scene

        if scn.MyBool:
            icon = 'X_VEC'
            txt = 'Cancel'
        else:
            icon = "PAUSE"
            txt = 'Pause'

        layout.prop(scn, 'MyBool', text=txt, icon=icon, toggle = True)
        layout.label(text= txt)

bpy.utils.register_module(__name__)