Re: Do we have scrolled canvases yet?

Carnage (S566@aacci.aacc.cc.md.us)
Sat, 11 Jan 1997 19:21:14 -0500 (EST)

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

On Mon, 6 Jan 1997, Steve Lamont wrote:

> The concept is pretty simple though. Basically just follow the
> cookbook instructions in the XForms manual to create a Canvas and
> register an activate handler (and possibly an init and cleanup
> handler, if necessary) with fl_modify_canvas_prop(). In the activate
> handler, get the Window of the Canvas with fl_get_canvas_id() and then
> use XCreateWindow() to create a child. That child can be as large as
> or larger than the parent (Canvas) window. Map the window with
> XMapWindow(). That's about it for creation.

Well, I finally got around to experimenting in making a scrolled
canvas. I'm wondering about a few things though ....

When you say "activate" handler, do you mean a handler to handle
the Expose event? I got my hands on this really thick book published by
Digital Press called _X Window System: C Library and Protocol Reference_,
and under the part about "Events", they did not list any kind of
"activate" event (at least, it wasn't called that). And the XForms manual
does mention an "Expose" event. So I'm guessing it's the Expose event I
need to handle, right?

How do you draw to the child window created with XCreateWindow()?
Do I use the XForms routines or the XLib ones?

> You'll probably need to register an event handler, too.
> Use XMoveWindow() to reposition the child window when scrolling.

And about scroll bars ... there doesn't seem to be an explicit
scroll bar class in XForms. Right now, I'm implementing scroll bars by
just using horizontal and vertical sliders. I have buttons with arrows as
labels (using @> strings) on them placed at the ends of the sliders.

This seems to be a satisfactory solution, but it kind of ruins the
consistency of the rest of the UI. Because the scroll bar on Browser
objects don't look like that. To make things consistent, I would need to
implement a new Browser-type object with the new style scroll bar.

Unless there is an explicit scroll bar class, and I just missed
it. If so, please tell me.

==============================================================================
Arcadio Alivio Sincero, Jr.
Undergraduate Computer Science Major/Linux Enthusiast/Competitive Bodybuilder
email: S566@aacci.aacc.cc.md.us
WWW: /cgi-bin/exit-to?http://www.geocities.com/SiliconValley/Pines/5181

"Bare feet magnetize sharp metal objects so they point upward from the floor,
especially in the dark."