Lisp HUG Maillist Archive

Resizing pinboard-layout without flashing.

Hi Lisp-Hug,
 
Let's say that I have an application such as .../examples/capi/graphics/circled-graph-nodes.lisp
 
The example specializes on capi:calculate-constraints to define the minimum size of an object.
 
Nonetheless, upon resize, the pinboard-layout flashes. To eliminate flash, I have unsuccessfully tried:
 
1.  capi:with-atomic-redisplay
 
2.  capi:validate-rectangle
 
3. Various :draw-pinboad-objects options
 
4. Specializing on gp:invalidate-rectangle or gp:clear-rectangle as recommended by the lisp-hug archive.  (But I'm not sure how correct this is advice because trace on gp:invalidate-rectangle and gp:clear-rectangle show that these methods are not called during resize).
 
Any suggestions?  I must admit that I've become a bit obsessive about eliminating flashing during pinboard-layout resize.  I think that it's probably because this is the ONLY problem I've ever had with LispWorks.
 
I'm using Windows XP and Windows Vista.
 
Thank you for any help,
 
R596

Re: Resizing pinboard-layout without flashing.

Have a look at examples/capi/applications/balloons.lisp.

OTOH, I would have expected capi:with-atomic-redisplay to work.  Maybe you are 
not wrapping it around "everything"?  Post a simple example.

pt


Re: Resizing pinboard-layout without flashing.

recent596 recent596 wrote:
> Hi Lisp-Hug,
>  
> Let's say that I have an application such as 
> .../examples/capi/graphics/circled-graph-nodes.lisp
>  
> The example specializes on capi:calculate-constraints to define the 
> minimum size of an object.
>  
> Nonetheless, upon resize, the pinboard-layout flashes. To eliminate 
> flash, I have unsuccessfully tried:
>  
> 1.  capi:with-atomic-redisplay
How have you tried with-atomic-redisplay? Did you define a 
resize-callback of your own and redraw all the pinboard objects within 
the with-atomic-redisplay?

Mitch


Re: Resizing pinboard-layout without flashing.

Hi Mitch,
 
Thanks for replying to my message. 
 
I posted an example of how I used with-atomic-redisplay in my reply to Paul. 
 
Do you think that there's a way to eliminate the flicker?  From my reading of the documentation and example code, I'm not really sure if this is actually a limit in CAPI.
 
What do you usually put in your resize-callback?  Do you use timers to limit the rate of redraws?
 
I wish I had a better mental model of pinboard redrawing.
 
R596

On Thu, Aug 21, 2008 at 8:36 PM, Mitch Berkson <mitch@bermita.com> wrote:
recent596 recent596 wrote:
Hi Lisp-Hug,
 Let's say that I have an application such as .../examples/capi/graphics/circled-graph-nodes.lisp
 The example specializes on capi:calculate-constraints to define the minimum size of an object.
 Nonetheless, upon resize, the pinboard-layout flashes. To eliminate flash, I have unsuccessfully tried:
 1.  capi:with-atomic-redisplay
How have you tried with-atomic-redisplay? Did you define a resize-callback of your own and redraw all the pinboard objects within the with-atomic-redisplay?

Mitch

Re: Resizing pinboard-layout without flashing.




Hi Paul,
 
Thank you for your response.  I posted an example below.  It flickers badly on Windows Vista.  Not as much on Windows XP.
 
I'm not sure what I'm doing wrong. 
 
I'm writing an inductive user interface.  The application is targeted at novice users.  I want to eliminate the flicker because the application must give the impression of solidity and reliability.
 
Thanks Paul; I would really appreciate any advice that you could offer..
 
R596
 

(in-package "CL-USER")
 
(defun make-contents ()
  (loop for r from 1 to 10
        collect (make-instance 'capi:rectangle
                               :x (random 800)
                               :y (random 600)
                               :width (* (random 8) 50)
                               :height (* (random 8) 50)
                               :filled t
                               :graphics-args `(:foreground
                                                ,(nth (random 5) '(:red :green :blue :yellow :black))))))
(capi:define-interface test ()
  ((contents :initform (make-contents)))
  (:panes
   (pb capi:pinboard-layout
        :draw-pinboard-objects :buffer
        :description contents
        :horizontal-scroll t
        :vertical-scroll t
        :resize-callback #'(lambda (pinboard x y width height)
                             ;;; Approach 1 (Uncomment this section only)
                             (capi:redraw-pinboard-layout pinboard x y width height nil)
                            
                             ;;; Approach 2 (Uncomment this section only)
                             ;;; (capi:with-atomic-redisplay (pinboard)
                             ;;;  (dolist (r contents)
                             ;;;    (when (capi:pinboard-object-overlap-p r
                             ;;;                                         x  y (+ x width)
                             ;;;                                         (+ y width))
                             ;;;     (capi:redraw-pinboard-object r nil))))))
                            ))       
  )
  (:default-initargs
   :auto-menus nil
   :best-height 400
   :best-width 500))
(capi:display (make-instance 'test))
       
       

On Thu, Aug 21, 2008 at 8:18 PM, Paul Tarvydas <tarvydas@visualframeworksinc.com> wrote:
Have a look at examples/capi/applications/balloons.lisp.

OTOH, I would have expected capi:with-atomic-redisplay to work.  Maybe you are
not wrapping it around "everything"?  Post a simple example.

pt


Re: Resizing pinboard-layout without flashing.

Hi Paul,
 
Thank you for your response.  I posted an example below.  It flickers badly on Windows Vista.  Not as much on Windows XP.
 
I'm not sure what I'm doing wrong. 
 
I'm writing an inductive user interface.  The application is targeted at novice users.  I want to eliminate the flicker because the application must give the impression of solidity and reliability.
 
Thanks Paul; I would really appreciate any advice that you could offer.
 
R596
 

(in-package "CL-USER")
 
(defun make-contents ()
  (loop for r from 1 to 10
        collect (make-instance 'capi:rectangle
                               :x (random 800)
                               :y (random 600)
                               :width (* (random 8) 50)
                               :height (* (random 8) 50)
                               :filled t
                               :graph ics-args `(:foreground
                                                ,(nth (random 5) '(:red :green :blue :yellow :black))))))
(capi:define-interface test ()
  ((contents :initform (make-contents)))
  (:panes
   (pb capi:pinboard-layout
        :draw-pinboard-objects :buffer
        :description contents
        :horizontal-scroll t
        :vertical-scroll t
        :resize-callback #'(lambda (pinboard x y width height)
                             ;;; Approach 1 (Uncomment this section only)
                             (capi:redraw-pinboard-layout pinboard x y width height nil)
                            
                             ;;; Approach 2 (Uncomment this section only)
                             ;;; (capi :with-atomic-redisplay (pinboard)
                             ;;;  (dolist (r contents)
                             ;;;    (when (capi:pinboard-object-overlap-p r
                             ;;;                                 ;         x  y (+ x width)
                             ;;;                                         (+ y width))
                             ;;;     (capi:redraw-pinboard-object r nil))))))
                     &nbs p;      ))       
  )
  (:default-initargs
   :auto-menus nil
   :best-height 400
   :best-width 500))
(capi:display (make-instance 'test))
       
       


- Show quoted text -
On Thu, Aug 21, 2008 at 8:18 PM, Paul Tarvydas <tarvydas@visualframeworksinc.com> wrote:

Have a look at examples/capi/applications/balloons.lisp.

OTOH, I would have expected capi:with-atomic-redisplay to work.  Maybe you are
not wrapping it around "everything"?  Post a simple example.

pt

Re: Resizing pinboard-layout without flashing.

Hi Eivind (and Paul and Mitch),
 
Oh my goodness, that was the problem -- the 'show window contents while dragging' Windows setting.  Thank you very much for pointing that out! 
 
Regards,
R596

On Mon, Aug 25, 2008 at 11:31 PM, Eivind Midtgård <eivind@autosim.no> wrote:


> -----Original Message-----
> From: owner-lisp-hug@lispworks.com
> [mailto:owner-lisp-hug@lispworks.com] On Behalf Of Paul Tarvydas
> Sent: Monday, August 25, 2008 3:41 PM
> To: recent596 recent596
> Cc: lisp-hug@lispworks.com
> Subject: Re: Resizing pinboard-layout without flashing.
>
>
> On Saturday 23 August 2008 12:04:27 pm recent596 recent596 wrote:
> >  Hi Paul,
> >
> > Thank you for your response.  I posted an example below.
> It flickers
> > badly on Windows Vista.  Not as much on Windows XP.
> >
> > I'm not sure what I'm doing wrong.
>
> I'm using LWW 5.1 on Win 2K.  I see no flashing whatsoever.
> I grab the lower right corner of the interface with the mouse
> and pull - the pinboard remains the same size until the mouse
> is released.  I can't try it on XP until later.


LWW 4.6.1, Windows XP.

The example circled-graph-nodes.lisp flickers when the XP setting 'Show window contents while dragging' is on, but does not flicker when the setting is off. Same with the example of recent596 (in an earlier post).

Look in Control Panel, Display, tab Appearance, button Effects.


HTH,
Eivind

Updated at: 2020-12-10 08:42 UTC