[Prev][Next][Index][Thread]
Re: Using DUIM's <viewport>
On Thu, 23 Mar 2000 16:45:02 Andrew W Armstrong wrote:
>
>--
>
>On Thu, 23 Mar 2000 07:15:02 Chris Double wrote:
>>Dustin Voss <agent_@mindspring.com> writes:
>>
>>> Can you (or anyone) think of a way to automatically repaint this?
>>> Maybe hook into some event somewhere?
>>
>>If you don't mind a bit of flicker when scrolling, adding the
>>following method will do the trick:
>
>Nice trick, Chris! A possibility that might work is to add a single drawing pane as the window to be scrolled, and to then add the list boxes to that.
>
>Here's an approximate sketch, I haven't tried this (I'll try and post a real version when I'm at home, unless Chris beats me to it):
OK, here's the real version (it turns out 'define pane' no longer uses <drawing-pane>, so I had to use a different solution):
define frame <scrolling-test> (<simple-frame>)
pane %column (pane)
make(<column-layout>,
children: vector(make(<push-button>, label: "Hello"),
make(<list-box>, items: #(1, 2, 3)),
make(<list-box>, items: #(4, 5, 6))));
layout (frame)
scrolling ()
make(<drawing-pane>,
children: vector(frame.%column),
foreground: #f)
end;
end frame <scrolling-test>;
define method main () => ()
start-frame(make(<scrolling-test>));
end method main;
The only problem with this solution is that the background of the scrolling area is now white instead of the default Windows color. I can't seem to find a way to ask a drawing pane to pick up the default color, if that is a problem for your application I'll try and find a way.
Just for the record, the bugs I'd like to see fixed are:
1. <viewport> does inappropriate bitblt'ing when scrolling collections of gadgets.
2. <drawing-pane> cannot pick up the correct default background color, because it is overriden with $white. Maybe we need another class (<gadget-pane>?) that uses the default gadget color, or maybe we need a way to override this behavior (:background $default-background, or something).
I hope this helps,
Andy
---------------------------
Andy Armstrong
andrewa@functionalobjects.com
MailCity. Secure Email Anywhere, Anytime!
http://www.mailcity.lycos.com
Follow-Ups: