Banner(3X) manual page
Table of Contents
Banner - one-line title bar
There is no corresponding Motif
widget for this interactor. It may not be suitable for Motif user interface
design.
#include <ivplus/banner.h>
Banner draws a one line
title bar with optional left-justified, centered, and right-justified headings.
The member variable highlight can be set to cause the drawing to display
with the foreground and background colors reversed. The natural size of
a banner depends on the size of its headings. Banners are infinitely stretchable
horizontally, but fixed size vertically.
Banner -> Interactor
The left string will be left-justified, the
middle string centered, and right string right-justified in the banner. Any
of the header strings can be omitted by passing a nil string.
Updates
the banner’s header strings. The strings can be set through the left, middle,
and right member variables. The Update() operation should be called after
one or more of the strings is changed.
This operation sets the member variables left, middle and
right to the respective char* passed in to the operation. It sets the
highlight member variable to false and the inverse member variable to
nil.
Performs any configuration specific to a
particular interactor.
Called when some portion of the interactor
needs to be redrawn.
Notifies an interactor that
its canvas has been created or modified.
None.
// Banner Example
#include <ivplus/box.h>
#include <ivplus/banner.h>
#include <ivplus/frame.h>
#include <ivplus/glue.h>
#include <ivplus/world.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 a banner with only the center header string.
Banner* title1 = new Banner(nil, "Window Mail Program", nil);
// Create a banner with three header strings: left, center, right.
Banner* title2 = new Banner("Ver1.0", "On Line Doc Viewer", " Page 1");
// Set highlight to cause foreground & background colors to be reversed.
title2->highlight = true;
// Change banner’s header string to new string and tell banner to update.
title2->right = "Page 2";
title2->Update();
// Insert the banner just created into a vbox.
VBox* mainbox = new VBox(title1, new VGlue, title2);
// Map the window.
world->InsertApplication(new Frame(mainbox, 1, BevelOut));
// Enter the event loop.
world->Run();
return 0;
}
banner.h
Interactor(3X)
.
Table of Contents