XtAppAddTimeOut and Expose Event - Not Getting event

XtAppAddTimeOut and Expose Event - Not Getting event

Post by Marcio Calixto Cabra » Sun, 20 Jan 2002 05:39:40



 Hi there,

 I am using XtAppAddTimeOut to constantly display captured images from a
frame grabber. The problem is that I try to force a expose event in order
to get that going. But it is not working. The only event the expose
callback routine gets is when I increase the size of the window. If I
decrease the size of it, the expose callback routine is not called.

 Here is my code. If someone could point me out what I am doing wrong, I'd
be greatfull.

  //add callback for exposure event
  XtAddCallback(DrawingAreaWidget, XmNexposeCallback, draw_cbk, this);

void TimeOutCallback(XDisplay *data, XtIntervalId *id)
{
  XEvent ev;      

  XtAppAddTimeOut((XtAppContext)data->getAppContext(),
                  100,
                  TimeOutCallback, data);

  ev.type = Expose;
  ev.xexpose.display = data->WidgetDisplay;
  ev.xexpose.window = data->WidgetWin;
  ev.xexpose.x = 2;
  ev.xexpose.y = 2;
  ev.xexpose.width = 220;
  ev.xexpose.height = 220;
  ev.xexpose.count = 0;
  XSendEvent (data->WidgetDisplay, data->WidgetWin, False, ExposureMask,
&ev);

  XFlush(data->WidgetDisplay);

Quote:}

 void draw_cbk()
{
 //Do the drawing

Quote:}

Bye,

Marcio Cabral