XForms: Need help with event callback

Francine Taylor (crystalx@teleport.com)
Tue, 1 Jul 1997 14:52:51 -0700 (PDT)

To subscribers of the xforms list from Francine Taylor <crystalx@teleport.com> :

First of all, what I needed was for a certain routine to be called
whenever a form was brought forward (first time it was displayed, whenever
the user clicked on a corner to bring it to the top, etc). There are
several forms which may be active at any given time.

I figured the best way to do this would be with an event callback,
trapping the Expose event. If this sounds wrong to anybody or y'all can
think of a better way to do it please let me know. It's only been a
couple of days since I picked up the XForms book so I'm pretty much a
beginner as that goes. I'm also completely new to object oriented
programming so talk baby talk to me, please :)

Anyway, this is what my program looks like so far:

in the .h file
--------------

typedef struct {
FL_FORM *MyForm;
.
.
FL_OBJECT *btnButton;
} FD_form;

in _main
--------

FD_form *pForm;
fl_initialize(.....
pForm = create_form_form();
fl_show_form(pForm->MyForm, .....
fl_addto_selected_xevent(FL_ObjWin(pForm->btnButton), ExposureMask);
fl_add_event_callback(FL_ObjWin(pForm->btnButton), Expose,
(FL_APPEVENT_CB)do_expose, 0);
fl_do_forms();

in callback file
----------------

void do_expose(Xevent *pXEvent, void *pParm)
{
fl_show_messages("do_expose called");
}

The Problem: do_expose is never called

Help, anyone? What am I doing wrong?

_\||/_
/ ^ ^ \
Francine Taylor (\| (o)(o) |/) crystalx@teleport.com
-------------------------OOOo--oo--oOOO------------------------------

_________________________________________________
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/