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

Name

HGlue - provide space between interactors in an HBox

Synopsis

#include <ivplus/glue.h>

Description

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

Class Hierarchy

HGlue->Glue->Interactor

Constructors

HGlue(int natural = 0, int stretch = hfil)

HGlue(const char* instanceName, int natural = 0, int stretch = hfil)

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

HGlue(int natural, int shrink, int stretch)

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

Construct hglue with a given natural size, shrinkability, and stretchability. If shrink is larger than natural the hglue can potentially have negative size, meaning interactors will overlap in an hbox.

Public Operations

None.

Protected Operations

None.

X Resources

None.

Examples


//                          HGlue 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 hglue with natural size of 20 pixels and no shrink or stretch.
   HGlue* hglue1 = new HGlue(20, 0,0);
   // Create hglue with natural size of 5 pixels and infinite stretchability.
   HGlue* hglue2 = new HGlue(5, hfil);
   // Create a horizontal box with these buttons and hglue.
   HBox* btnbox = new HBox(new HGlue, btn1,
                         hglue1, btn2,
                         hglue2, btn3, new HGlue);
   // 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) , Interactor(3X) , Shape(3X) , VGlue(3X) , World(3X) .


Table of Contents