Re: XForms: Focus on a choice list?

Steve Lamont (spl@szechuan.ucsd.edu)
Wed, 25 Jun 97 06:42:40 PDT

To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

Frank Stefani sez:
>
> Steve Lamont wrote:
>
> > Frank Stefani wrote:
>
> > > how can I determine, if the mouse currently clicked on the
> > > pulldown botton of a choice list and the list is now opened?
>
> > You might be able to get some sort of pre-notification with a
> > pre-handler but I haven't ever tried (or wanted to try) to do such a
> > thing so I'm not sure at what point the pre-handler is called. I
> > suspect it will take a little experimentation.
>
> Among other objects I have 4 choice objects on a form. Now, when
> one choice receives a click I want to offer an additional tool
> to be started with parameters specific to the opened choice list.

I just tested the method I suggested. It seems to do what you wish,
if I understand the question correctly.

fl_set_object_prehandler( fd_try->choice, prehandler );

[...]

int prehandler( FL_OBJECT *obj, int event, FL_Coord mx, FL_Coord my,
int key, void *raw_event )

{

if ( event == FL_PUSH )
do_your_special_thing();

return !FL_PREEMPT;

}

prehandler() gets called prior to processing of any event for the
Choice object. Just select for FL_PUSH and you're off and running.

This, of course, only works for the initial FL_PUSH. Once the Choice
menu is deployed, the function is not called, so if you wanted to
change your special object as the pointer touches each separate item
in the list, this wouldn't work and I can't think of any way to do
this other than crufting your own replacement object. I don't suppose
it would be that difficult to do.

Hope this is responsive.

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