Re: XForms: deactivate button

Dave (rewd@ded1.dyn.ml.org)
Tue, 22 Sep 1998 20:42:02 -0700 (PDT)

# To subscribers of the xforms list from Dave <rewd@ded1.dyn.ml.org> :

On Tue, 22 Sep 1998, Steve Lamont wrote:
>
> > Am I using the fl_deactivate_object() improperly? I have four buttons set
> > up, when button 3 is pushed, I would like to deactivate button 2. I used
> > the fdesign program to create the form and both the callback name and
> > button name are the same.

This did the trick, thanks. :-)

>
> Generally, objects are referred to through the `fdui' structure
> created by `fdesign'. For instance, if you had four buttons defined
> and named, you'd end up with something that looks like
>
> typedef struct
> {
> FL_FORM *form;
> void *vdata;
> char *cdata;
> long ldata;
> FL_OBJECT *button1;
> FL_OBJECT *button2;
> FL_OBJECT *button3;
> FL_OBJECT *button4;
> }
> FD_some_form;
>
> Now, assuming that you have a button callback wherein you want to
> deactivate some other button, you can code something like
>
> void button_cb( FL_OBJECT *ob, long parm )
>
> {
>
> if ( fl_get_button( ob ) ) {
>
> FD_some_form *fd_some_form =
> ( FD_some_form *) ob->form->fdui;
> FL_OBJECT *button2 = fd_some_form->button2;
>
> fl_deactivate_object( button2 );
>
> }
>
> }

--
This sig intentionally left blank.

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