Integrating Rogue Wave Views with an X Application Using libxviews
The Xlib version has the capability of integrating any Xlib-based application as soon as it is provided a pointer to a Display object, a Window to draw to, and a way to receive events from it.
In the following sections, you will find information on:
Integration Steps
To use Rogue Wave Views with any Xlib-based toolkit, you have to :
1. Create an
IlvDisplay instance using an existing X Display.
IlvDisplay::IlvDisplay(IlAny exitingXDisplay, const char* name);
For example:
Display* xdisplay;
// ... initialize this Display*: xdisplay = XOpenDisplay(...);
IlvDisplay* ilvdisplay = new IlvDisplay((IlAny)xdisplay, "Views");
IlvView::IlvView(IlvDisplay* display,
IlvSystemView existingXWindow)
For example:
IlvDisplay* display;
// initialize this 'display'
Window xWindow;
// initialize this X window
IlvView* view = new IlvView(display, (IlvSystemView)xWindow);
or
IlvContainer* container = new IlvContainer(display,
(IlvSystemView)xWindow);
3. Manage the events in these
IlvView views :
Once you receive an X event, you must call
IlvEventLoop::getEventLoop()->dispatchEvent(&xevent);
Complete Template
The main procedure looks like this:
main()
{
// Initialize your toolkit
Display* xdisplay;
xdisplay = // XOpenDisplay...;
// Initialize an IlvDisplay
IlvDisplay* ilvdisplay = new IlvDisplay((IlAny)xdisplay, "Views");
// Create an X window:
Window xwindow;
xwindow = // ...;
// Create an IlvContainer
IlvContainer* container = new IlvContainer(display,(IlvSystemView)xwindow);
container->addObject(new IlvLabel(...));
// Now call the toolkit main event loop
}
Version 6.1
Copyright © 2016, Rogue Wave Software, Inc. All Rights Reserved.