Running ViewKit ObjectPak Applications

Once you have instantiated a VkApp object and set up your program's interface, call VkApp::run():

virtual void run()

The run() function enters a custom main loop that supports dispatching raw events in addition to the normal Xt event handling. See "ViewKit ObjectPak Event Handling" for more information on event handling.

Note: Do not call XtMainLoop(3) or XtAppMainLoop(3) in a ViewKit ObjectPak application.

Example 11. illustrates the typical use of the VkApp class in the main body of a ViewKit ObjectPak program.

Example 11. Using VkApp


#include <Vk/VkApp.h>
// Application-specific setup
void main ( int argc, char **argv )
VkApp *myApp = new VkApp("MyApp", &argc, argv);
// Application-specific code
myApp->run(); // Run the application