vfake.note - VFake widget documentation ******************************************************************************* * VToolkit (1995) "If it doesn't use VToolkit, it isn't cool!" * * (c) Steve Klein * * Unpublished rights reserved under the copyright laws of the United States. * ******************************************************************************* This document describes the VFake widget. +----------------------+ | Modification History | +----------------------+ 14-Nov-1991 (sjk) Add VFakeNwindowType resource and options. 05-Apr-1990 (sjk) Add MOTIF support and update documentation. The VFake widget is a special class of widget that allows one application to cleanly access windows that were created by another application. By using the VFake widget, you can continue to use XtMainLoop to dispatch all events, even if your application did not create all the windows it deals with. Other solutions to the problem of accessing windows created by other applications usually rely on writing a private version of XtMainLoop that has special filtering and dispatching logic for windows on a "hit" list. The VFake widget is a convenient way to register an external window with the toolkit intrinsics so that event handlers and actions can be registered on that window by using the normal intrinsics calls, such as XtAddEventHandler, etc. The VFake widget has two widget-class-specific resources: +---------- | VFakeNWindowType (int, default = VFakeWindowTypeAny) This resource determines how the VFake widget gets its window ID. It must have one of the following values: VFakeWindowTypeAny VFakeWindowTypeRoot VFakeWindowTypeAny means that the VFakeNwindow resource should be used to determine the window ID of the target window. The application must provide a value for the VFakeNwindow resource before realizing the VFake widget. VFakeWindowTypeRoot means that the VFake widget will use the root window of the screen for which it is created. The VFakeNwindow resource is ignored. | +---------- +---------- | VFakeNWindow (Window, default = none) If the VFakeNwindowType resource is VFakeWindowTypeRoot, this resource is ignored. Otherwise, The VFakeNwindow resource must be set to the window ID of the target window. The resource must be set prior to the realization of the VFake widget. This is NOT a dynamic resource. Once the widget has been realized, changes to this resource are ignored. | +---------- The VFake widget is a popup widget. Do not call XtManageChild for this widget. Call XtRealizeWidget after you have set the VFakeNwindow resource. Look at the sample program VDragRoot for an example of how to use the VFake widget. VDragRoot is a "hack" that, when running, enables the user to move any window on the screen. By holding down the shift and control keys and pressing MB3 (shift-control-MB3) and dragging the mouse, any window on the screen can be moved. Don't worry - the new window positions are not saved. -steve-