Nevu event
NevuEvent
A wrapper object for managing and executing events/callbacks.
Specific kwargs
| Argument | Type | Description |
|---|---|---|
sender |
Any |
the object that triggers the event. |
function |
Callable |
the function to be executed. |
type |
EventType |
category of the event (e.g., Click, Hover). |
*args |
Any |
positional arguments for the function. |
**kwargs |
Any |
keyword arguments for the function. |
Methods
| Name | Kwargs | Description |
|---|---|---|
__call__ |
*args, **kwargs |
executes the stored function. If new args/kwargs are passed, they overwrite the stored ones. |
Use case
from nevu_ui import *
import pygame
pygame.init()
window = Window((500, 500), title = "NevuEvent example")
nevu_event = NevuEvent(None, lambda: print("Hi!"), EventType.OnClick)
nevu_event()
from nevu_ui import *
import pyray
window = Window((500, 500), title = "NevuEvent example", backend = Backend.RayLib)
nevu_event = NevuEvent(None, lambda: print("Hi!"), EventType.OnClick)
nevu_event()
Created with GGen v1.1.0 for nevu_ui v0.7.5