Skip to content

loop_end

malibx.loop_end(mlx: Mlx) -> None

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 loop returns. You can draw into them and call loop again.
  • Called outside a running loop, it does nothing. The next loop starts 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")

See also

loop ยท hook (event 17: close button)