Re: scrollable area

The Tick (
Sat, 8 Mar 1997 12:58:48 -0500 (EST)

To subscribers of the xforms list from The Tick <> :

On Sat, 8 Mar 1997, Christian RABEDAORO wrote:
> Hi All,
> I am a new user of the forms lib. I encounter a problem when i try
> to perform a scrollable area in which i intend to locate large drawings.
> Actually, i would like to draw scroll bars on my drawing area, i heard of
> using slider and creating a child window. Could someone give more details
> on how to do that? C code example would be welcome.

I was doing this a few months ago. That is, making a scrolled
canvas. Steve Lamont gave me some pointers, and he'll probably give you
some too just as soon as he sees your post :-). I never really finished
my implementation, but it basically worked.

What I did was basically what you just said. I made a really
large window a child of an XForms canvas. Then I simply moved the window
around inside the canvas, which gave the effect of scrolling. I use
XMoveWindow() (I forget the exect name of the XLib function ... I don't
have my XLib reference handy). If you're new to XLib, there are some
snafus to watch out for. But it wasn't that difficult.

And yes, you can use sliders as scroll bars to control the
scrolling. The thing I never got around to implementing is having the
"thumb" of scroll bar adjust it's size to reflect the size of the child
window (you know, the bigger the size of the child window to be scrolled
got, the smaller the thumb size should get).

Arcadio Alivio Sincero, Jr. a.k.a. The Tick
Undergraduate Computer Science Major/Linux Enthusiast/Competitive Bodybuilder
WWW: /cgi-bin/exit-to?

Come meet me on for Quake or for IRC!

To unsubscribe, send the message "unsubscribe" to or see
Xforms Home Page:
List Archive: