1 #include "Stopwatch_display.h"
2 #include "ace/OS_NS_stdio.h"
4 Stopwatch_display::Stopwatch_display (Widget
&parent
)
6 // Instantiate the sub-components of the Stopwatch_display
7 this->frame_
= XtCreateWidget ("frame",
13 this->label_
= XtCreateWidget ("label",
20 Stopwatch_display::~Stopwatch_display ()
26 Stopwatch_display::manage ()
28 XtManageChild (this->frame_
);
29 XtManageChild (this->label_
);
33 Stopwatch_display::set_time (CORBA::Float time
)
37 // Format value as a string
38 ACE_OS::sprintf (buf
, "%6.3f", time
);
40 // Convert to compound string
41 XmString xmstr
= XmStringCreateSimple (buf
);
43 // Display the string in the Label widget
44 XtVaSetValues (this->label_
, XmNlabelString
, xmstr
, static_cast<void *>(0));
45 //??Can use XtSetValues with ac and al values..
47 // The compound string can be freed once passed to the widget