Re: XForms: X event callback help needed

Steve Lamont (
Fri, 3 Oct 97 06:46:56 PDT

To subscribers of the xforms list from (Steve Lamont) :

> To do the meter I created a canvas object and then used Xlib calls to
> set the faceplate pixmap as a backgroud and then XClearWindows() would
> redraw the pixmap and XDrawLines() to actually draw the meter movement.
> While this worked well I noticed that the needle would not be redrawn
> after it's window is covered/uncovered by another window. Ofcourse, this
> is because the Xforms canvas object only knows about the pixmap meter
> face and not the needle. ...

You should register a canvas handler for the Expose event:

fl_add_canvas_handler( your_canvas, Expose,
your_expose_event_handler, your_void_data );

Refer to the manual section on Canvas event handlers for the details
on how to construct the event handler. In your case, you'd probably
want to do an XClearArea() or XClearWindow() and then redraw your
meter needle.

BTW, this is probably a dumb question and please don't think me rude
but why would you want to replicate the interface (front panel) of a
piece of ham gear on a computer screen. It would seem to me that the
best interface for operating a radio would be the radio.

I get into this argument around here when working on some electron
microscope automation projects -- my contention is that the best
interface for operating an electron microscope is the microscope
itself. Trying to move functionality from the piece of hardware to
pixels on a screen always seems to me to be a giant leap backward...


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