[][src]Function rs_glfw3::bindings::glfwSetWindowCloseCallback

pub unsafe extern "C" fn glfwSetWindowCloseCallback(
    window: *mut GLFWwindow,
    cbfun: GLFWwindowclosefun
) -> GLFWwindowclosefun

@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] cbfun 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).

@errors Possible errors include @ref GLFW_NOT_INITIALIZED.

@remark @osx 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