loop_end¶
MiniLibX: mlx_loop_end
Makes the running loop return once the current frame is done.
Parameters¶
| Name | Type | Description |
|---|---|---|
mlx |
Mlx |
The connection whose loop should stop |
Returns¶
None.
Notes¶
- The frame still finishes: event hooks already queued for it still run.
- Windows stay open after
loopreturns. You can draw into them and callloopagain. - Called outside a running loop, it does nothing. The next
loopstarts normally.
Example¶
import malibx
ESC = 0xFF1B
mlx = malibx.init()
win = malibx.new_window(mlx, 320, 200, "press Esc")
def on_key(keysym, _):
if keysym == ESC:
malibx.loop_end(mlx)
malibx.key_hook(win, on_key)
malibx.loop(mlx)
print("bye")