Xdbe Still Causes Flickering...?

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

2 posts / 0 new
Last post
Xdbe Still Causes Flickering...?

Submitted by Anonymous (not verified) on

Fri, 06/15/2012 - 12:07

Hi all gurus,
I have following code that implements Xdbe. Yet it's still flickering. I hope someone can give me enlightment...
#include
#include
#include
#include
#include
using namespace std;
XdbeBackBuffer bb;
void OnPaintCallback(Widget w, XtPointer clientData, XtPointer callData)
{
XGCValues values;
XtGCMask mask = GCForeground | GCBackground | GCFillStyle | GCLineStyle;
values.foreground = BlackPixelOfScreen(XtScreen(w));
values.background = None;
values.fill_style = FillSolid;
values.line_style = LineDoubleDash;
GC gc = XCreateGC(XtDisplay(w), bb, mask, &values);
XFillRectangle(XtDisplay(w), bb, gc, 200, 200, 400, 300);
XdbeSwapInfo sinf;
sinf.swap_action = XdbeBackground;
sinf.swap_window = XtWindow(w);
XdbeSwapBuffers(XtDisplay(w), &sinf, 1);
XFreeGC(XtDisplay(w), gc);
}
void OnMouseMoveEventHandler(Widget w, XtPointer clientData, XEvent *event, Boolean *pass)
{
XClearArea(XtDisplay(w), XtWindow(w), 0, 0, 0, 0, True);
}
int main(int argc, char *argv[])
{
Arg al[10];
int ac;
XtAppContext app;
ac = 0;
Widget top = XtOpenApplication(&app, "Rdps", NULL, 0, &argc, argv, NULL, sessionShellWidgetClass, al, ac);
ac = 0;
Widget panel = XmCreateForm(top, "Panel", al, ac);
ac = 0;
XtSetArg(al[ac], XmNwidth, 800); ac++;
XtSetArg(al[ac], XmNheight, 600); ac++;
///*
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
//*/
Widget drawing = XmCreateDrawingArea(panel, "drawing", al, ac);
XtManageChild(drawing);
XtManageChild(panel);
XtRealizeWidget(top);
bb = XdbeAllocateBackBufferName(XtDisplay(drawing), XtWindow(drawing), XdbeBackground);
XtAddEventHandler(drawing, PointerMotionMask, False, OnMouseMoveEventHandler, (void*)bb);
XtAddCallback(drawing, XmNexposeCallback, OnPaintCallback, NULL);
XtAppMainLoop(app);
return 0;
}
‹ How to get fewer Expose events when changing many Widgets How much children a composite widget can handle? ›

 

Submitted by yahubat on

Submitted by yahubat on

Tue, 07/17/2012 - 10:00

 

Mon, 06/12/2006 - 07:45#1

ismailfaruqi

Xdbe Still Causes Flickering...?

Um, i have found the solution for this problem, thanks...