new_ml_button

NAME
SYNOPSIS
DESCRIPTION
AUTHOR
LICENSE
VERSION

NAME

new_ml_button, ml_button_set_text, ml_button_get_text, ml_button_set_callback, ml_button_set_key - monolith button widget

SYNOPSIS

#include <ml_button.h>

ml_button new_ml_button (pool pool, const char *text);
void ml_button_set_text (ml_button, const char *text);
const char *ml_button_get_text (ml_button);
void ml_button_set_callback (ml_button, void (*fn)(ml_session, void *), ml_session, void *);
void ml_button_set_key (ml_button, int is_key);

DESCRIPTION

A button widget is a simple button which calls a function when clicked.
new_ml_button creates a new button widget.
ml_button_(set|get)_text updates the HTML text printed on the button. Note that the text string must be either static, or already allocated in the button's pool, or allocated in a pool with a longer lifetime than the button. If the text is set to NULL then this has the same effect as setting the text to the empty string, which is not very useful because the button can never be pressed.
ml_button_set_callback updates the callback function which is invoked when the button is pressed.
ml_button_set_key sets the boolean "key" property of the button. This should be set on buttons where the text is a single letter, suitable for, say, calculator keys. All key buttons are rendered at a fixed width of "1em", resulting in a more pleasing overall effect.
ml_button_set_popup sets the popup property of the button. When the user clicks on a popup button, a new popup window opens on the screen. To make a button into a popup button, the popup property should be a non-NULL string which is the name of the new browser window (note that because of limitations in HTML, browser window names are global, so it is recommended that names be "appname_name"). To change a popup button back to an ordinary button, set the popup property to NULL.
The callback used by a popup button must create a top-level window, otherwise you will get an internal server error.
ml_button_set_popup_size changes the size of the popup window. The default is width 0, height 0, which usually creates a popup window which is the same size and shape as the current browser window.

AUTHOR

Richard Jones <rich@annexia.org>

LICENSE

GNU LGPL (see http://www.gnu.org/)

VERSION

monolith-1.0.0