[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    VGlue(3X) manual page Table of Contents

Name

VGlue - provide space between interactors in a vbox

Synopsis

#include <ivplus/glue.h>

Description

VGlue defines variable-size space between interactors in vboxes. Along its minor axis (horizontal for VGlue), Vglue has a natural size of zero and infinite stretchability. Vglue uses pixels as the unit of measurement, but inches or centimeters can be specified using the constants inch, inches, cm, or mm.

Class Hierarchy

VGlue->Glue->Interactor

Constructors

VGlue(int natural = 0, int stretch = vfil)

VGlue(const char* instanceName, int natural = 0, int stretch = vfil)

Construct vglue with a given natural size and stretchability. The vglue’s shrinkability is defined to be the same as the natural size, meaning it can shrink to zero. The predefined value vfil represents an infinite amount when used for stretchability or shrinkability.

VGlue(int natural, int shrink, int stretch)

VGlue(const char* instanceName, int natural, int shrink, int stretch)

Construct vglue with a given natural size, shrinkability, and stretchability. If shrink is larger than natural, the vglue can potentially have negative size. This means that interactors will overlap in a box.

Public Operations

None.

Protected Operations

None.

X Resources

None.

Examples


//                          VGlue Example
#include <ivplus/box.h>
#include <ivplus/button.h>
#include <ivplus/frame.h>
#include <ivplus/glue.h>
#include <ivplus/world.h>
#include <string.h>
int main(int argc, char **argv)
{
   // Create the world to get the connection with the display.
   World* world = new World("MyApp", argc, argv);
   // Create three push buttons.
   PushButton* btn1 = new PushButton("Button1", new ButtonState(0), 1);
   PushButton* btn2 = new PushButton("Button2", new ButtonState(0), 1);
   PushButton* btn3 = new PushButton("Button3", new ButtonState(0), 1);
   // Create vglue with natural size of 20 pixels and no shrink or stretch.
   VGlue* vglue1 = new VGlue(20, 0,0);
   // Create vglue with natural size of 5 pixels and infinite stretchability.
   VGlue* vglue2 = new VGlue(5, hfil);
   // Create a vertical box with these buttons and vglue.
   VBox* btnbox = new VBox(new VGlue, btn1,
                         vglue1, btn2,
                         vglue2, btn3, new VGlue);
   // Map the window.
   world->InsertApplication(new Frame(btnbox, 1, BevelOut));
   // Enter the event loop.
   world->Run();
   return 0;
}

Files


glue.h

See Also

Box(3X) , Glue(3X) , HGlue(3X) , Interactor(3X) , Shape(3X) .


Table of Contents