Re: scrollable area

The Tick (S566@aacci.aacc.cc.md.us)
Sat, 8 Mar 1997 12:58:48 -0500 (EST)

To subscribers of the xforms list from The Tick <S566@aacci.aacc.cc.md.us> :

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
email: S566@aacci.aacc.cc.md.us
WWW: /cgi-bin/exit-to?http://www.coming.to.a.web.site.near.you.com

Come meet me on quake.linpeople.org for Quake or irc.linpeople.org for IRC!

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
Xforms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/xforms-archive/