Re: positioning a form

Steve Lamont (spl@szechuan.ucsd.edu)
Fri, 3 Jan 97 08:30:10 PST

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

> okay - are the title-bar height and border width available through
> xforms?

Border width is available in the `bw' field of the FL_FORM structure.
You can infer the height of the title bar by querying the position of
the Form window:

XWindowAttributes attributes;
FL_FORM *form;

[...]

XGetWindowAttributes( fl_get_display(), form->window,
&attributes );

fprintf( stderr, "x = %d, y = %d\n",
attributes.x,
attributes.y )

The value of attributes.y will be the height of the title bar.

> On a different note, is there a function that will behave like pushing
> the button with the mouse (push the desired button and unpush the
> others in a group of radio buttons in a group as well as trigger to
> callback)? If not, is there at least a function that will unpush all
> the buttons in a group?

This little hack will unpush all buttons in a group:

void unpush( FL_OBJECT *obj )

{

do
if ( ( obj->objclass == FL_BUTTON ) &&
( obj->type == FL_RADIO_BUTTON ) )
fl_set_button( obj, 0 );
while ( ( obj = obj->next )->objclass != FL_END_GROUP );

}

spl