Re: Do we have scrolled canvases yet?

Carnage (S566@aacci.aacc.cc.md.us)
Mon, 13 Jan 1997 22:34:24 -0500 (EST)

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

On Mon, 13 Jan 1997, Steve Lamont wrote:
> Are you sure that the region where you're drawing is visible? Have

Yes.

> you set a foreground color when you draw? You may be drawing and just
> not seeing the result because it's the same color as the background.
> See the Xlib manual for the function XSetForeground() to set this.

I tried that, but still no go.

This is pretty frustrating. Just to see what would happen, I
changed my childCanvas from being a child of the XForms canvas to a child
of the root window. I did this to try and acertain whether or not XForms
could be somehow interfering with my write calls to my childCanvas (hey
... I did say I was new to this X Window programming thing, didn't I :-)).
To my dismay, it still didn't work. I can't write squat to my window!

I was wondering, if isn't too much trouble, if you could post a
small example of XLib coding which:

1) Opens a window.
2) Draws a rectangle in it.

I'd very much appreciate it!

> > Since I'm probably going to ask the following question eventually, I
> > better ask it now: how do I get childCanvas to pass on Expose events to
> > the parent canvas so that it's Expose handler can get called?
> See the function fl_add_canvas_handler() in the XForms manual.

That's what I did. In my Expose handler, I had it just write to
stdout "Exposed!". When I XMapWindow()'d my childCanvas, "Exposed!"
wasn't getting written to stdout anymore, which means my Expose handler
wasn't getting called anymore. Which,I hypothesize, must be because
childCanvas covers the entire XForms canvas, the XForms canvas is not ever
"exposed" anymore and thus my Expose handler no longer gets called.
Therefore, I need a way for childCanvas to explicitly send to the XForms
canvas an Expose event so that my Expose handler gets a chance to get
called. Or I could try attaching an event handler to my childCanvas ...
but I wanna stay out of XLib as much as possible (at least until I can get
my hands on a decent XLib book).

Sure would be cool if you could make an XForms canvas a child of
another XForms canvas. That way I can stay out of XLib all together and
stick to good 'ol, easy-to-use, XForms :-).

==============================================================================
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."