gandi_acts(3) - Linux man page
Name
Actions in GANDI and their handlers.Synopsis
bool (* GANDIact_timer)(void *);
void (* GANDIact_pre_focus)(void *);
void (* GANDIact_post_focus)(void *);
int (* GANDIact_resize)(void *, int nlines, int ncols, int y, int x);
int (* GANDIact_pre_driver)(void *, int);
GANDIT_drvret (* GANDIact_driver)(void *, int);
GANDIT_drvret (* GANDIact_post_driver)(void *, int, GANDIT_drvret);
void (* GANDIact_kill)(void *);
Description
For all functions the first argument is a widget which has to handle the action.bool (* GANDIact_timer)(void *);
Is called by GANDI timer demand, see gandi_timer(3gandi). Return value determines whether a call to GANDI_update (see gandi_touch(3gandi)) is neccesary.void (* GANDIact_pre_focus)(void *);
Is called when focus is going to given to the widget. GANDI_active points to this widget too.void (* GANDIact_post_focus)(void *);
Is called when focus leaves the widget. GANDI_active points to the widget to be activated (its pre_focus is not executed yet).int (* GANDIact_resize)(void *, int nlines, int ncols, int y, int x);
Is called when widget is to be resized. The border (see gandi_gandiw(3gandi)) is just resized.The parametres are the new size and widget position (the last is not changed but it is often used in these functions).
Must return OK if all right and ERR otherwise.
int (* GANDIact_pre_driver)(void *, int);
Is called after keymap_sys treatment and super_driver (see gandi_driver(3gandi)) if the flag GANDI_drvCONT is set.The int parameter is a pressed key or its value (see gandi_keymap(3gandi)).
Return value is what driver (the next function) will recieve.
GANDIT_drvret (* GANDIact_driver)(void *, int);
Is called with the same conditions and after the pre_driver.The int argument is the return value of pre_driver if it was executed or the key value (see gandi_keymap(3gandi)) otherwise.
The return value is described in gandi_driver(3gandi).
GANDIT_drvret (* GANDIact_post_driver)(void *, int, GANDIT_drvret);
Is called after all other drivers (see gandi_driver(3gandi)) if the flag GANDI_drvSTOP is not set.The int argument is the same as the one for the driver. The GANDIT_drvret argument is the return value of driver.
The return value overrides the one recieved from driver.
void (* GANDIact_kill)(void *);
This handler is called when the widget is being killed. Nothing happend yet: all children (see gandi_children(3gandi)) are alive, the widget is in the register (see gandi_register(3gandi)) and nothing else.This action is a way to free all customly allocated memory (like the caption in GANDIW_text_label) which core cannot know.
Notes
In order to set these action handlers use the GANDI_setact_ prefix followed by the action name. E.g. GANDI_setact_post_driver. Also there are GANDI_getact_ macros. For the timer handler you can use GANDI_setwidget_timer_handler as well as GANDI_setact_timer.Each of these handlers may be NULL.
