Using Rogue Wave Views on X Window Systems > Integrating Rogue Wave Views with a Motif Application using libmviews
 
Integrating Rogue Wave Views with a Motif Application using libmviews
Rogue Wave® Views was designed to be easily integrated with existing Motif applications. The library libmviews provides a way to connect an IlvView with an existing Motif widget and the mechanism required to respond to user action.
Note: For important restriction on using libmviews with Motif application, please refer to Using the Motif Version, libmviews.
In the following sections, you will find information on:
*Initializing Your Application
*Retrieving Connection Information
*Using an Existing Widget
*Running the Main Loop
*Sample Program Using Motif and Rogue Wave Views
Initializing Your Application
When integrating Rogue Wave Views code with a Motif-based application, you can create a Rogue Wave Views session in two different ways: you can use either the standard Rogue Wave Views initialization procedure or use the initialization block of the Motif application and call the second constructor of the IlvDisplay class, as shown below:
Standard Rogue Wave Views Initialization Procedure
IlvDisplay* display = new IlvDisplay("Program", "", argc, argv);
Here, Rogue Wave Views establishes the connection with the display system.
Motif Application Initialization Procedure
Widget top = XtInitialize("", "Program", NULL, NULL, (Cardinal*)&argc, argv);
if (!top) {
IlvFatalError("Couldn’t open display");
exit(1);
}
IlvDisplay* display = new IlvDisplay(XtDisplay(top), "X");
Here, standard Xt function calls initialize the connection. You have to specify the application name in the constructor of IlvDisplay to be able to find display resources from this string.

Version 5.7
Copyright © 2013, Rogue Wave Software, Inc. All Rights Reserved.