Lisp HUG Maillist Archive

(Lisp-HUG) Visible :Invisible CAPI Panes...

Greetings to the List on this beautiful spring day in the Rocky Mountains...

In my application, I have a small CAPI pane onto which I need to 
scroll, a line of pixels at a time, a periodic "event status" string.

I am not using a regular scrollable pane as it seems to scroll a line 
of text at a time, which appears jerky with this small 22-pixel high pane.

When I receive a string that I need to scroll up the pane, I first 
write the string text into an "invisible" area of the pane, and then 
repeatedly PixBlt the string image up the pane a row of pixels at a 
time separated by (Sleep 0.1) calls to generate the smooth scrolling effect.

This works very nicely indeed and I end up with a smoothly scrolling 
string.  It scrolls halfway up and then delays for 500-milliseconds 
and then scrolls the rest of the way and disappears off the top.  Neato...

However, I can't keep the "Invisible" area of the pane where I write 
the string invisible.

I define the pane with :internal-min/max-width/height statements (say 
100 pixels for all) along with :visible-min/max-width/height 
statements (say 50 pixels), so that the visible area is smaller than 
the invisible area.

I write the string (gp:draw-string) to the invisible area and then 
gp:PixBlt the string to the visible area a line of pixels at a time.

If I have the visible/invisible areas defined as described above, I 
get no string image PixBlted over at all - just black area.

If I set the :internal and :visible sizes the same, I get the string 
correctly - but the area needed to not be visible shows, of course, 
on the screen.

I assume that :visible means just that - the area visible on the 
screen. If an area is *not* :visible, then it should not display and 
you should see just the background color of the interface.

The CAPI documentation says, "Visible constraints control the size of 
the part of the pane that you can see", which seems straightforward enough.

What am I missing???  What difference is there in gp:draw-string(ing) 
a string to a visible area and a not-visible area?

All of this is happening in the callback for the pane which is 
gp:Invalidate-Rectangle'd once a second "elsewhere". The callback 
springs to life and checks an mp:mailbox for an incoming string to 
scroll etc etc etc. So, I am confident that I am running in the 
correct process. Everything works perfectly as long as the :internal 
and :visible parameters are the same.

Thoughts??


Regards,

Jack Harper
Secure Outcomes Inc.
Evergreen, Colorado USA


Re: (Lisp-HUG) Visible :Invisible CAPI Panes...

Unable to parse email body. Email id is 10042

Re: (Lisp-HUG) Visible :Invisible CAPI Panes...

At 04:32 PM 3/15/2010, Paul Tarvydas wrote:
>My first guess is that capi is being smart and not wasting time by 
>draw-string'ing to invisible (clipped) portions of the port (which 
>would be consistent with your observation that you're pixblt'ing blackness).
>
>You could try creating a separate pixmap port (not a part of your 
>GUI so it's invisible but not clipped) with gp:create-pixmap-port, 
>then draw-string'ing to it and then pixblt'ing from it to the on-screen port.
>
>Another thing to investigate is the difference between default 
>scrolling behaviour and pane-controlled scrolling - you might be 
>able to scroll one row of pixels at a time if you tell capi that you 
>want to do it yourself.
>
>pt


Paul - Very interesting comment.

I had not considered the thought that CAPI might try to optimize away 
the rendering in the invisible area.

I will try the create-pixmap-port, as you suggest, and see what's 
what with that.

Regards,

Jack Harper
Secure Outcomes Inc.
Evergreen, Colorado USA



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