set_close_button_callback man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

set_close_button_callback(3)	Allegro manual	  set_close_button_callback(3)

NAME
       set_close_button_callback - Handles the user clicking on the close but‐
       ton of the window. Allegro game programming library.

SYNOPSIS
       #include <allegro.h>

       int set_close_button_callback(void (*proc)(void));

DESCRIPTION
       On platforms that have a close button, this routine installs a callback
       function	 to  handle  the  close	 event.	 In other words, when the user
       clicks the close button on your	program's  window  or  any  equivalent
       device, the function you specify here will be called.

       This  function should not generally attempt to exit the program or save
       any data itself. The function could be called at any time, and there is
       usually	a  risk	 of  conflict  with  the  main	thread of the program.
       Instead, you should set a flag during this function, and test it	 on  a
       regular basis in the main loop of the program.

       Pass  NULL as the `proc' argument to this function to disable the close
       button functionality, which is the default state.

       Note that Allegro cannot intercept the close button of  a  DOS  box  in
       Windows.

       Also  note that the supplied callback is also called under MacOS X when
       the user hits Command-Q or selects "Quit" from  the  application	 menu.
       Example:

	  volatile int close_button_pressed = FALSE;

	  void close_button_handler(void)
	  {
	     close_button_pressed = TRUE;
	  }
	  END_OF_FUNCTION(close_button_handler)
	  ...

	  allegro_init();
	  LOCK_FUNCTION(close_button_handler);
	  set_close_button_callback(close_button_handler);
	  ...

	  while (!close_button_pressed)
	     do_stuff();

RETURN VALUE
       Returns	zero  on  success and non-zero on failure (e.g. the feature is
       not supported by the platform).

SEE ALSO
       set_window_title(3)

Allegro				 version 4.4.2	  set_close_button_callback(3)
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net