FLTK 1.3.2

- Main Page
- Related Pages
- Modules
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions
Fl_Pack Class Reference

This widget was designed to add the functionality of compressing and aligning widgets. More...

`#include <Fl_Pack.H>`

Inheritance diagram for Fl_Pack:

List of all members.

## Public Types
enum | { VERTICAL = 0, HORIZONTAL = 1 }
## Public Member Functions
| Fl_Pack (int x, int y, int w, int h, const char *l=0)
| Creates a new Fl_Pack widget using the given position, size, and label string.
uchar | horizontal () const
| Same as Fl_Group::type()
int | spacing () const
| Gets the number of extra pixels of blank space that are added between the children.
void | spacing (int i)
| Sets the number of extra pixels of blank space that are added between the children.
## Protected Member Functions
void | draw ()
| Draws the widget.

## Detailed Description

This widget was designed to add the functionality of compressing and aligning widgets.

If type() is Fl_Pack::HORIZONTAL all the children are resized to the height of the Fl_Pack, and are moved next to each other horizontally. If type() is not Fl_Pack::HORIZONTAL then the children are resized to the width and are stacked below each other. Then the Fl_Pack resizes itself to surround the child widgets.

This widget is needed for the Fl_Tabs. In addition you may want to put the Fl_Pack inside an Fl_Scroll.

The resizable for Fl_Pack is set to NULL by default.

See also: Fl_Group::resizable()

## Constructor & Destructor Documentation

Fl_Pack::Fl_Pack | ( | int | X,
|  | int | Y,
|  | int | W,
|  | int | H,
|  | const char * | l = `0`
| ) |  |

Creates a new Fl_Pack widget using the given position, size, and label string.

The default boxtype is FL_NO_BOX.

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 Fl_Pack and all of it's children can be automatic (local) variables, but you must declare the Fl_Pack first, so that it is destroyed last.

## Member Function Documentation

void Fl_Pack::draw | ( |  | ) | `[protected, virtual]`

Draws the widget.

Never call this function directly. FLTK will schedule redrawing whenever needed. If your widget must be redrawn as soon as possible, call redraw() instead.

Override this function to draw your own widgets.

If you ever need to call another widget's draw method from within your own draw() method, e.g. for an embedded scrollbar, you can do it (because draw() is virtual) like this:

            Fl_Widget *s = &scroll;         // scroll is an embedded Fl_Scrollbar
            s->draw();                      // calls Fl_Scrollbar::draw()

Reimplemented from Fl_Group.

The documentation for this class was generated from the following files:

- Fl_Pack.H
- Fl_Pack.cxx