예제 #1
0
 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
예제 #2
0
 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
예제 #3
0
 def decorator(callback: PyGuiCallback) -> PyGuiCallback:
     dpgcore.set_item_callback(self.id,
                               wrap_callback(callback),
                               callback_data=data)
     return callback
예제 #4
0
 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
예제 #5
0
 def set_callback(self, callback: PyGuiCallback) -> None:
     """Set the callback used by DearPyGui."""
     dpgcore.set_item_callback(self.id, wrap_callback(callback))