[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XForms] Canvas / button interaction

From: Clive Stubbings
Subject: Re: [XForms] Canvas / button interaction
Date: Sat, 11 Feb 2012 21:19:03 +0000 (GMT)


Getting closer..

I changed the code so it paints the 'yellow' button as being the full size of the window (ie 300x200)..

Clicking the button, I get a strip 10 pixels high at the top of the window. So I moved the canvas from (10,10) to (10,25)... And I get a strip 25 pixels high...

So somewhere the the polygon fill is being clipped to the top edge of the canvas. Can't see it at the momet though.

If I create 2 canvases, its the top one that sets the limit - order doesn't seem to matter.


On Sat, 11 Feb 2012, Clive Stubbings wrote:


I've been having a bit more look at windows.

What seems to happen is:

        A main form window (id 1e00018) is created
        GC get created on that
        Then a pixmap is created (id 1e0003a)
        The pixmap is used for some initial drawing of the objects
        The canvas is created with a window (id 1e0003b)
        some more drawing happens on the pixmap
        the pixmap gets copied to the display

        A click event on the checkbutton does its
        object drawing on the original (id 1e00018) window

        An expose seems to go via the pixmap.

There may be something unstable here too. I'm sure that in the past an expose event anywhere on the form was enough to cause the objects to be re-drawn. However in my current build, which has -g enabled and some debug messages, thats not true any more - expose the button and its displayed, but the expose region has to include the object..

Basically at the moment it seems to copy a pixmap to 1e00018 but not draw a polygon on it....

XCopyArea( flx->display, p->pixmap, p->win, flx->gc, 0, 0, p->w, p->h, p->x, p->y );


XFillPolygon( flx->display, flx->win, flx->gc, xp, n, Nonconvex, CoordModeOrigin );



On Fri, 10 Feb 2012, Jens Thoms Toerring wrote:

Hi Clive,

On Fri, Feb 10, 2012 at 01:37:46AM +0000, Clive Stubbings wrote:
More bits of data..

Adding XFlush() and XSync() calls after the polygon draw makes no difference.

A redraw as a result of an expose event - eg window raise does
result in correct drawing.

Interestingly, it can be any part of the window that is exposed - it
doesn't have to be the bit with the button in it, or the bit with the

Two things that are different in the 2 cases are the clipping calls and
the value of flx->win, but it looks like they are not the problem.

Mmm, the different flx->win values worry me a bit. can there
something be going wrong with double buffering?

Jens, any idea how to fake an expose event in Xforms? I'd like to
see if what makes the difference is a real X-expose event or whether
its something different in the xforms handling of expose vs draw.

I guess you could use fl_XPutBackEvent() to stick an arti-
ficially created event into XForms' event queue...

                              Best regards, Jens
 \   Jens Thoms Toerring  ________      address@hidden
  \_______________________________      http://toerring.de

reply via email to

[Prev in Thread] Current Thread [Next in Thread]