my app broke with commit 613841ac9cdac00f6613a718b5f6dd902dab8d16

14 views
Skip to first unread message

Martin DeMello

unread,
Jan 6, 2013, 2:55:29 AM1/6/13
to eql-...@googlegroups.com
(sorry if this is the wrong place, i couldn't find an issue tracker on
gitorious)

My app at https://github.com/martindemello/xw-eql/blob/master/lisp/xw.lisp
is broken by commit 613841ac9cdac00f6613a718b5f6dd902dab8d16 - when
the mouse is clicked, (draw) calling (qfun *xw* "repaint") does not
trigger the paint function, but blanks out the entire grid. Curiously
enough it works when a cursor key is pressed.

martin

Polos Ruetz

unread,
Jan 6, 2013, 5:28:07 AM1/6/13
to eql-...@googlegroups.com
2013/1/6, Martin DeMello <martin...@gmail.com>:
> (sorry if this is the wrong place, i couldn't find an issue tracker on
> gitorious)

I didn't set up an issue tracker, maybe I should.

> My app at https://github.com/martindemello/xw-eql/blob/master/lisp/xw.lisp
> is broken by commit 613841ac9cdac00f6613a718b5f6dd902dab8d16 - when
> the mouse is clicked, (draw) calling (qfun *xw* "repaint") does not
> trigger the paint function, but blanks out the entire grid. Curiously
> enough it works when a cursor key is pressed.

Oh, I see, so I solved one problem by introducing another one...
That's embarassing, I will look into this soon.

Paul

Polos Ruetz

unread,
Jan 6, 2013, 7:21:16 AM1/6/13
to eql-...@googlegroups.com
2013/1/6, Polos Ruetz <polos...@gmail.com>:
> 2013/1/6, Martin DeMello <martin...@gmail.com>:
>> My app at
>> https://github.com/martindemello/xw-eql/blob/master/lisp/xw.lisp
>> is broken by commit 613841ac9cdac00f6613a718b5f6dd902dab8d16

Please see new version 13.1.1, which fixes the newly introduced bug.
I tested all code of mine, and everything worked well.

But you need to make a small change in your app, in your "draw" function:

solution 1: call "update" instead of "repaint" (recommended)
(qfun *xw* "update")

solution 2: if you really want to call "repaint" (not needed here), do
it like so:
(qsingle-shot 0 (lambda () (qfun *xw* "repaint")))

Paul

Martin DeMello

unread,
Jan 6, 2013, 10:24:39 PM1/6/13
to eql-...@googlegroups.com
Works nicely now!

martin

Polos Ruetz

unread,
Jan 7, 2013, 5:29:56 AM1/7/13
to eql-...@googlegroups.com
2013/1/6, Polos Ruetz <polos...@gmail.com>:
> solution 2: if you really want to call "repaint" (not needed here), do
> it like so:
> (qsingle-shot 0 (lambda () (qfun *xw* "repaint")))

I realized that QSINGLE-SHOT together with "repaint" is like saying
"do it now, but later" (which is nonsense).

So, after another change regarding QOVERRIDE, you can now use
"repaint" again if you like (without QSINGLE-SHOT).

(This is a bit tricky, since I want to allow calling the base
implementation directly from overriden function(s), which can be
nested too, as in your app).

Paul

Martin DeMello

unread,
Jan 7, 2013, 6:40:15 AM1/7/13
to eql-...@googlegroups.com
Conceptually, should I be using `update` or `repaint`? I only used the
latter because I saw some of the examples using it as their on-change
callback.

martin

Polos Ruetz

unread,
Jan 7, 2013, 7:23:08 AM1/7/13
to eql-...@googlegroups.com
2013/1/7, Martin DeMello <martin...@gmail.com>:
> Conceptually, should I be using `update` or `repaint`? I only used the
> latter because I saw some of the examples using it as their on-change
> callback.

Please see Qt Assistant and QWidget::update().

("repaint" paints immediately, "update" schedules a repaint, which is
sufficient in most cases)
Reply all
Reply to author
Forward
0 new messages