def delink_callback(self, callback: Optional[PyGuiCallback]) -> Callable: """Set the delink callback, can be used as a decorator.""" if callback is not None: callback = wrap_callback(callback) self._on_delink_callback = callback return callback
def resized(self, callback: PyGuiCallback) -> Callable: """Set resized callback, can be used as a decorator.""" dpgcore.set_resize_callback(wrap_callback(callback), handler=self.id) return callback
def decorator(callback: PyGuiCallback) -> PyGuiCallback: dpgcore.set_item_callback(self.id, wrap_callback(callback), callback_data=data) return callback
def on_close(self, callback: Optional[PyGuiCallback]) -> Callable: """Set on_close callback, can be used as a decorator.""" if callback is not None: callback = wrap_callback(callback) self._on_close_callback = callback return callback
def set_callback(self, callback: PyGuiCallback) -> None: """Set the callback used by DearPyGui.""" dpgcore.set_item_callback(self.id, wrap_callback(callback))