class fltk::Tile


Class Hierarchy

fltk::Group
   |
   +----fltk::Tile

Include Files

#include <fltk/Tile.h>

Description

fltk::Tile makes it possible for the user to dynamically drag the edges of child widgets. If two adjoining widgets are created such that their edges touch, eg. 2a and 2b, the user can drag the common edge, affecting both widgets.

In the example program, all neighboring widgets share the same edge, so that the user can drag any edge, and affect all widgets sharing that edge. All the widgets in this example have box(fltk::DOWN_BOX), and the widget's thick borders make it appear as though the widgets aren't actually touching, but they are:

fltk::Tile allows objects to be resized to zero dimensions. To prevent this you can use the resizable() to limit where corners can be dragged to.

Even though objects can be resized to zero sizes, they must initially have non-zero sizes so the fltk::Tile can figure out their layout. If desired, call position() after creating the children but before displaying the window to set the borders where you want.

Methods

fltk::Tile::Tile(int x, int y, int w, int h, const char *label = 0)

Creates a new fltk::Tile widget using the given position, size, and label string. The default boxtype is fltk::NO_BOX.

virtual fltk::Tile::~Tile()

The destructor also deletes all the children. This allows a whole tree to be deleted at once, without having to keep a pointer to all the children in the user code. A kludge has been done so the fltk::Tile and all of it's children can be automatic (local) variables, but you must declare the fltk::Tile first, so that it is destroyed last.

void fltk::Tile::position(from_x, from_y, to_x, to_y)

Drag the intersection at from_x, from_y to to_x,to_y. This redraws all the necessary children.

void fltk::Tile::resizable(fltk::Widget &w)
void fltk::Tile::resizable(fltk::Widget *w)

The resizable() child widget (which should be invisible) limits where the border can be dragged to. If you don't set it, it will be possible to drag the borders right to the edge, and thus resize objects on the edge to zero width or height. The resizable() widget is not resized by dragging any borders.