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

Re: Using DUIM's <viewport>



Dustin Voss <agent_@mindspring.com> writes:

> Although the get-default-background doesn't work with <win32-port>
> from HD, I'm going to use this technique with the white background.
> I haven't dug through the source, but do you know why this works,
> but not "pane scrolling() vertically() yadda-yadda end end"?

My description below is based on what I've dug up stepping through the
source. Andy or Scott would have a better idea about how things work
in reality.

>From what I can see there is a generic function that handles the
scrolling of the viewport that the 'scrolling' macro creates. This
function is called 'scroll-viewport-child'. If you look in
source/gadgets/viewports.dylan you'll see two methods. One specialised
on <sheet> and the other on <mirrored-sheet-mixin>.

The <row-layout> and <column-layout> classes do not have an actual
win32 back end version of the class. They appear to be handled mostly
in Dylan. When these classes are the child of the viewport then the
method that gets called to handle the scroll is the generic <sheet>
version. This one does various calculations and ultimately a
bitblt. It's this one that seems to have the problem.

The <drawing-pane> class does have a win32 back end, and scrolling
this results in the <mirrored-sheet-mixin> version of the method being
called. This one probably does more optimized win32 stuff to do the
scrolling and it doesn't have a problem. 

So any class that has a win32 representation should work fine with
scrolling. For example, I just tried it with <group-box> and it works
too. As long as the <mirrored-sheet-mixin> version of the method gets
called.

You can set breakpoints on these methods while your program is running
and see the different methods getting called based on whatever is
inside the scrolling macro.


Chris.
-- 
http://www.double.co.nz/dylan



References: