class close_event


class close_event
    : public event

Description

A close event occurs when a user tries to close a window. Call set_should_close(false) on the close event to specify that the window should not be closed.

Public Member Functions

explicit
close_event (
    bool initial_should_close
)
noexcept

Constructs a close event with the given decision as to whether the associated window should be closed.

Parameters:
  • initial_should_close:

    The value that indicates whether the associated window should be closed.

close_event (
    const close_event& other
)

Copy-constructs a close_event from an existing one.

Parameters:
  • other:

    The close_event to copy from.

close_event&
operator = (
    const close_event& other
)

Copy-assigns a close_event into this one.

Parameters:
  • other:

    The close_event to copy from.

close_event (
    close_event&& other
)
noexcept

Move-constructs a close_event from an existing one.

Parameters:
  • other:

    The close_event to move from.

close_event&
operator = (
    close_event&& other
)
noexcept

Move-assigns a close_event into this one.

Parameters:
  • other:

    The close_event to move from.

bool
should_close ()
const noexcept

Returns true if the window associated with this event should be closed. Otherwise, returns false. This is something you can change by calling set_should_close.

void
set_should_close (
    bool new_value
)
noexcept

Records whether the window associated with this event should be closed.

Parameters:
  • new_value:

    The value that indicates whether the associated window should be closed.



Copyright © 2022-2025 Daniel T. McGinnis

CCL was first published in 2022, and is still actively maintained.

This website was first published in 2022, and is still actively maintained.

This specific web page was first published in 2023.