I have a panel with a play button, which starts a timer. Every time I click on the button, it changes from play to pause and vice versa:
class PlayPanel(bpy.types.Panel):
is_playing = False
def draw(self, context):
play_panel_draw(context, self.layout)
def play_panel_draw(context, layout):
row.operator("Play", text="", icon='PLAY' if not PlayPanel.is_playing else 'PAUSE')
Now, I want to change the icon also when the timer stops. How can I do that? In the draw function I'm passing the context and the layout. How can I pass them from the timer class?