summaryrefslogtreecommitdiff
path: root/TAO/tests/Xt_Stopwatch/README
blob: cbd37f5000fe6418e4aef9f1da7150038e13a482 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# $Id$

Introduction:
------------
This example illustrates the usage of the XtReactor from TAO.  The
server creates a small display dialog and the client displays a dialog
with a start and stop button.  On pressing the start button the server
dialog box starts a stopwatch.  On the pressing the stop the stopwatch
stops. On repressing the start the stopwatch resets and start all over
again.

To run the server and the client simply do the following:

$ server -o foo.ior
$ client -k file://foo.ior

Note: this test only does something useful if the Xtoolkit is enabled
and the executables linked against the following libraries Xm, Xt &
X11.

---------------------------------------------------------------------
Technical Description:
In addition to specifying the resources that the ORB needs to allocate
for an Xt event loop, the ORB also needs the information about the
XtAppContext in which the user application is initialised. To provide
these information TAO provides a class by name
"TAO_XT_Resource_Factory" that inherits from the
TAO_Default_Resource_factory. This provides the user with a static
method through which he can set the XtAppContext. 

To make TAO understand that the user is in fact wants to use the
TAO_XT_Resource_Factory and not the default resource factory, the
application developer must add the following line to his svc.conf
file. 

dynamic Resource_Factory Service_Object *
TAO:_make_TAO_XT_Resource_Factory() ""

Please see the line of code in server.cpp that sets the XtAppContext
in the TAO_XT_Resource_factory.

One more interseting observation would be to note that the server and
client  run on the Xt event loop by calling the  XtAppMainLoop ().