Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

set_close_button_callback(3alleg4) [debian man page]

set_close_button_callback(3alleg4)				  Allegro manual				set_close_button_callback(3alleg4)

NAME
set_close_button_callback - Handles the user clicking on the close button 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(3alleg4) Allegro version 4.4.2 set_close_button_callback(3alleg4)

Check Out this Related Man Page

set_close_button_callback(3alleg4)				  Allegro manual				set_close_button_callback(3alleg4)

NAME
set_close_button_callback - Handles the user clicking on the close button 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(3alleg4) Allegro version 4.4.2 set_close_button_callback(3alleg4)
Man Page

9 More Discussions You Might Find Interesting

1. Programming

C program

Hi, There is a C program with "check_log(log_loc,log_name,path)" in it. It seems that this C program is calling a check_log function but I didn't see any function called check_log in it. By the way, the C program itself is called 'check_log' I am just trying to learn a litter bit about C.... (6 Replies)
Discussion started by: whatisthis
6 Replies

2. Programming

file ptr2.

what happens when we don't close a file pointer ? (3 Replies)
Discussion started by: bankpro
3 Replies

3. Programming

main function

Is it possible to execute any function before main() function in C or C++. (6 Replies)
Discussion started by: arun.viswanath
6 Replies

4. HP-UX

kill idle users

Hi, In my network we uses the NetTerm program to connect us to HP-UX 10.x server from windows workstations, but in some cases the user doesn't logout and close it by window's x button. The problem is that in HP-UX the user and all his tasks remain active and when he enter again HP-UX creates a... (12 Replies)
Discussion started by: efrenba
12 Replies

5. Programming

C reading file

Hi, how can i read first line two times without close file? (9 Replies)
Discussion started by: littleboyblu
9 Replies

6. Programming

Fork thread, Assertion failed. X11.

Hi all. I wrote a program with the Motif Widget Toolkit. It has a button and a scrollbar. When the user hits the button the callback creates a new fork() thread. The new thread sleeps for a while and then changes the position of the scrollbar. It does this in an endless loop. I need the... (2 Replies)
Discussion started by: mghis
2 Replies

7. Programming

[C] close server after user input

i must close server after a specific user input, such as FINE, if i put a test inside function "maiuscolatore" i receive an error on second recv of client. why? below there are code of client and server: CLIENT: #include <stdlib.h> #include <stdio.h> #include... (0 Replies)
Discussion started by: tafazzi87
0 Replies

8. Post Here to Contact Site Administrators and Moderators

Request to close a thread that has been answered

Good Afternoon, The following post "how-get-program-name-produced-io-error-redirected-log-nohup-command" is already answered. You can go ahead and close it. Thanks for your help. Best regards. (1 Reply)
Discussion started by: enriquegm82
1 Replies

9. Programming

Javascript question: using the image button

I have javascript that I want to use to build up a dynamic array: the user clicks on one or more images and when clicking the Show button, the list of image names is displayed that the user clicked. <script type="text/javascript"> var images = ; images =... (0 Replies)
Discussion started by: figaro
0 Replies