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__)