pub unsafe extern "C" fn glfwSetWindowCloseCallback(
window: *mut GLFWwindow,
callback: Option<unsafe extern "C" fn(*mut GLFWwindow)>,
) -> Option<unsafe extern "C" fn(*mut GLFWwindow)>Expand description
@brief Sets the close callback for the specified window.
This function sets the close callback of the specified window, which is called when the user attempts to close the window, for example by clicking the close widget in the title bar.
The close flag is set before this callback is called, but you can modify it at any time with @ref glfwSetWindowShouldClose.
The close callback is not triggered by @ref glfwDestroyWindow.
@param[in] window The window whose callback to set.
@param[in] callback The new callback, or NULL to remove the currently set
callback.
@return The previously set callback, or NULL if no callback was set or the
library had not been [initialized](@ref intro_init).
@callback_signature @code void function_name(GLFWwindow* window) @endcode For more information about the callback parameters, see the [function pointer type](@ref GLFWwindowclosefun).
@errors Possible errors include @ref GLFW_NOT_INITIALIZED.
@remark @macos Selecting Quit from the application menu will trigger the close callback for all windows.
@thread_safety This function must only be called from the main thread.
@sa @ref window_close
@since Added in version 2.5. @glfw3 Added window handle parameter and return value.
@ingroup window