XForms: form positioning and placement flags

J. P. Mellor (jpmellor@ai.mit.edu)
Mon, 30 Nov 1998 09:58:16 -0500

# To subscribers of the xforms list from "J. P. Mellor" <jpmellor@ai.mit.edu> :

When creating 2 forms the second form is inconsistent placed.
Depending on whether the forms are created sequentially

fl_set_form_geometry(form1, ...);
fl_show_form(form1, ...);
fl_set_form_geometry(form2, ...);
fl_show_form(form2, ...);

or mixed

fl_set_form_geometry(form1, ...);
fl_set_form_geometry(form2, ...);
fl_show_form(form1, ...);
fl_show_form(form2, ...);

and which placement flag is used the second form is positioned
differently. I'm only considering placement flags which should
respect the postion set by fl_set_form_geometry() and both forms have
the same geometry. I have seen 3 different placements for the second
form: 1) aligned with the 1st form; 2) Shifted up and to the left by
the size of the window decorations; and, 3) Random (changes each time
the code is run). I would perfer 1) across the board. I would rather
that the form position be off by the size of the decorations and be
consistently placed then have it inconsistently placed depending on
whether it's the first form or not and which placement flag is used.

Below is a table which summarizes the problem and a simple program
which demonstrates it. I'm using version 0.88 on linux 2.0.34 with
fvwm.

jp

Sequential Mixed
FL_PLACE_GEOMETRY Shifted Shifted
FL_PLACE_POSITION Shifted Shifted
FL_PLACE_SIZE Aligned Random
FL_PLACE_ASPECT Aligned Random
FL_PLACE_FREE Shifted Random

/* this program tests the positioning of forms - the first form
* is positioned differently than subsequent forms.
*/

#include <forms.h>
#include <stdlib.h>

typedef struct {
FL_FORM *form;
void *vdata;
long ldata;
} FD_form;

/* #define BUG 3 */

#if defined (BUG) && BUG == 1
int
main(int argc, char **argv)
{
FL_OBJECT *obj;
FD_form form1, form2;

fl_initialize(&argc, argv, 0, 0, 0);
form1.form = fl_bgn_form(FL_UP_BOX, 200, 200);
fl_end_form();
fl_set_form_geometry(form1.form, 100, 100, 200, 200);
fl_show_form(form1.form, FL_PLACE_GEOMETRY, FL_FULLBORDER, "Form 1");

form2.form = fl_bgn_form(FL_UP_BOX, 200, 200);
fl_end_form();
fl_set_form_geometry(form2.form, 100, 100, 200, 200);
fl_show_form(form2.form, FL_PLACE_GEOMETRY, FL_FULLBORDER, "Form 2");

obj = fl_do_forms();
return 0;
}
#elif defined (BUG) && BUG == 2
int
main(int argc, char **argv)
{
FL_OBJECT *obj;
FD_form form1, form2;

fl_initialize(&argc, argv, 0, 0, 0);
form1.form = fl_bgn_form(FL_UP_BOX, 200, 200);
fl_end_form();
form2.form = fl_bgn_form(FL_UP_BOX, 200, 200);
fl_end_form();
fl_set_form_geometry(form1.form, 100, 100, 200, 200);
fl_set_form_geometry(form2.form, 100, 100, 200, 200);
fl_show_form(form1.form, FL_PLACE_GEOMETRY, FL_FULLBORDER, "Form 1");
fl_show_form(form2.form, FL_PLACE_GEOMETRY, FL_FULLBORDER, "Form 2");

obj = fl_do_forms();
return 0;
}
#elif defined (BUG) && BUG == 3
int
main(int argc, char **argv)
{
FL_OBJECT *obj;
FD_form form1, form2;

fl_initialize(&argc, argv, 0, 0, 0);
form1.form = fl_bgn_form(FL_UP_BOX, 200, 200);
fl_end_form();
form2.form = fl_bgn_form(FL_UP_BOX, 200, 200);
fl_end_form();
fl_set_form_geometry(form1.form, 100, 100, 200, 200);
fl_set_form_geometry(form2.form, 100, 100, 200, 200);
fl_show_form(form1.form, FL_PLACE_GEOMETRY, FL_FULLBORDER, "Form 1");
fl_show_form(form2.form, FL_PLACE_ASPECT, FL_FULLBORDER, "Form 2");

obj = fl_do_forms();
return 0;
}
#else
int
main(int argc, char **argv)
{
FL_OBJECT *obj;
FD_form form1, form2;

fl_initialize(&argc, argv, 0, 0, 0);
form1.form = fl_bgn_form(FL_UP_BOX, 200, 200);
fl_end_form();
fl_set_form_geometry(form1.form, 100, 100, 200, 200);
fl_show_form(form1.form, FL_PLACE_GEOMETRY, FL_FULLBORDER, "Form 1");

form2.form = fl_bgn_form(FL_UP_BOX, 200, 200);
fl_end_form();
fl_set_form_geometry(form2.form, 100, 100, 200, 200);
fl_show_form(form2.form, FL_PLACE_GEOMETRY, FL_FULLBORDER, "Form 2");

obj = fl_do_forms();
return 0;
}
#endif
_________________________________________________
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/