new_ml_window

NAME
SYNOPSIS
DESCRIPTION
AUTHOR
LICENSE
VERSION

NAME

new_ml_window, ml_window_pack, ml_window_set_title, ml_window_get_title, ml_window_set_stylesheet, ml_window_get_stylesheet, ml_window_set_charset, ml_window_get_charset, new_ml_frameset, ml_frameset_set_description, ml_frameset_set_title, ml_frameset_get_title - monolith window and frameset

SYNOPSIS

#include <ml_window.h>

ml_window new_ml_window (struct ml_session *, pool pool);
void ml_window_pack (ml_window, ml_widget);
void ml_window_set_title (ml_window, const char *title);
const char *ml_window_get_title (ml_window);
void ml_window_set_stylesheet (ml_window, const char *stylesheet);
const char *ml_window_get_stylesheet (ml_window);
void ml_window_set_charset (ml_window, const char *charset);
const char *ml_window_get_charset (ml_window);
ml_window new_ml_frameset (struct ml_session *, pool pool, const char *rows, const char *cols, vector frames);
void ml_frameset_set_description (ml_window, struct ml_session *, const char *rows, const char *cols, vector frames);
void ml_frameset_set_title (ml_window, const char *);
const char *ml_frameset_get_title (ml_window);

DESCRIPTION

A "window" is a top-level window. Every application has at least one window, created in the main function. A window is just a wrapper. To actually do anything, you must pack a single widget inside the window. Windows can only take a single widget. If you want more than one widget to appear inside a window, then you must pack them into some sort of layout widget first, and pack the layout widget into the window.
A "frameset" is used to create framesets (several ordinary windows packed into one top-level window, with independent scrolling capabilities). Windows and framesets are actually so similar, that I have included them in the same class (and also so that other code can deal with an opaque ml_window pointer and not have to worry about whether it is a window or a frameset). Framesets may contain windows or other framesets, or a mixture of both.
Monolith windows are not widgets (unlike many of the other classes in monolith).
new_ml_window creates a new monolith window.
ml_window_pack packs a widget into the window. Since a window can only contain a single widget, subsequent calls to this function overwrite the packed widget. (Note: this call does not apply to framesets).
ml_window_(set|get)_title changes the title of the window. The title of the window defaults to no title at all, so it is a good idea to set this.
ml_window_(set|get)_stylesheet changes the stylesheet of the page. Monolith default stylesheets are installed in /ml-styles/, and the default stylesheet is /ml-styles/default.css (supplied in the monolith distribution). Stylesheets are used to 'theme' monolith applications.
ml_window_(set|get)_charset changes the character encoding associated with the window. Because of limitations in HTML, only a single charset can be associated with all of the widgets in a window. The default charset is iso-8859-1. For multilingual support, it is recommended that users change the charset to either their native language encoding, or to utf-8.
new_ml_frameset creates a new frameset. rows and cols define the number of frames and their layout. You can use rows and cols to create frameset layouts including grids, as described in the HTML 4 standard (http://www.w3.org/TR/html401/). To create nested framesets, use a frame which generates a frameset instead of a window. frames is a vector of struct ml_frame_description structures (note: the structures themselves, not pointers to the structures). struct ml_frame_description contains the following fields:
fn: The function which is called generate the frame (or nested frameset). This function must call either new_ml_window or new_ml_frameset. The function is prototyped as void fn (ml_session session, void *data);.
data: Data pointer passed to this function.
ml_frameset_set_description allows the frameset description to be updated.
ml_frameset_(set|get)_title updates the window title.

AUTHOR

Richard Jones <rich@annexia.org>

LICENSE

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

VERSION

monolith-1.0.0