GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  ]

class Fl_Pack

Class Hierarchy

Include Files

    #include <FL/Fl_Pack.H>


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.


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

Creates a new Fl_Pack widget using the given position, size, and label string. The default boxtype is FL_NO_BOX.

virtual Fl_Pack::~Fl_Pack()

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_Packfirst, so that it is destroyed last.

Fl_Boxtype Fl_Pack::box() const
void Fl_Pack::box(Fl_Boxtype)

Gets or sets the box type for the widget, which identifies a routine that draws the background of the widget. Only frame box types may be used with the Fl_Pack widget.

void Fl_Pack::resizable(Fl_Widget *box)
void Fl_Pack::resizable(Fl_Widget &box)
Fl_Widget *Fl_Pack::resizable() const

The resizable for Fl_Pack is set to NULL by default.

See also: Fl_Group::resizable()

int Fl_Pack::spacing() const
void Fl_Pack::spacing(int)

Gets or sets the number of extra pixels of blank space that are added

User Comments [ Add Comment ]

From Daniel J. Lauk, 04:15 Jan 17, 2004 (score=1)

The types for Fl_Pack are _not_ FL_HORIZONTAL and FL_VERTICAL! They don't have the prefix "FL_" as can be seen in <FL/Fl_Pack.H>:

class FL_EXPORT Fl_Pack : public Fl_Group {
  int spacing_; public:
  enum { // values for type(int)
    VERTICAL = 0,
  }; //... and so on ...
Reply ]


Comments are owned by the poster. All other content is copyright 1998-2021 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to ''.