Created
January 9, 2018 18:21
-
-
Save Paulchen-Panther/1399585f10f83772c7e694518cdb7acc to your computer and use it in GitHub Desktop.
Python callback
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from enum import Enum | |
from plugin import * | |
import time | |
import random | |
def onCompStateChangedAllEvents(comp, state): | |
log("onCompStateChangedAllEvents called") | |
def onCompStateChangedSpecificEvents(comp, state): | |
log("specific event " + comp + " called") | |
log("register callbacks") | |
#the callback onVisiblePriorityChangedAllEvents() is registered to all Events | |
registerCallback(ON_COMP_STATE_CHANGED, onCompStateChangedAllEvents) | |
#the callback onVisiblePriorityChangedAllEvents() is only registered to the specific Events COMP_SMOOTHING and COMP_BLACKBORDER | |
registerCallback(ON_COMP_STATE_CHANGED, onCompStateChangedSpecificEvents, [COMP_SMOOTHING, COMP_BLACKBORDER]) | |
log("callback register complete") | |
while not abort(): | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment