XForms: problem resizing forms

Jan Menzel (jan.menzel@gmx.de)
Sun, 03 Oct 1999 14:06:33 +0200

# To subscribers of the xforms list from Jan Menzel <jan.menzel@gmx.de> :

This is a multipart MIME message.

--==_Exmh_11253150760
Content-Type: text/plain

Hello,
while playing with a little form (code emitted by fdesign included), i noticed,
that resizing the form a few times to a lower size than its designed one, the
application crashes. Before the crash i already noticed the form having different
aspect ratio (???).
In details: if you resize the included form vertically (e.g. to 50% of its
designed size and back to 100%), the 8 sliders began to move upwards in the form. The
lower side is two high and the upper side of the slider has covered the text box and
also reached the frames label. By doing that some more time the forms objects get
invisible. If you resize the form horizontally, the sliders wits changes dramatically:
the second and sixth is mostly unusable small, the wits of the fifth is twice as large
as designed, the distance between different sliders has also changed significant and
the frame is not centered insight the window anymore. By resizing the form that way
three or four times the application crashes with:
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 53 (X_CreatePixmap)
Value in failed request: 0x0
Serial number of failed request: 42204
Current serial number in output stream: 42392
All that was done using the included form with v0.89 on a Linux box with
glibc2.0 (Thanks Mr. Zhao).

Cheers Jan

--==_Exmh_11253150760
Content-Type: text/plain ; name="8sliders_form.c"
Content-Description: 8sliders_form.c
Content-Disposition: attachment; filename="8sliders_form.c"

/* Form definition file generated with fdesign. */

#include "forms.h"
#include <stdlib.h>
#include "8sliders_form.h"

FD_slider *create_form_slider(void)
{
FL_OBJECT *obj;
FD_slider *fdui = (FD_slider *) fl_calloc(1, sizeof(*fdui));

fdui->slider = fl_bgn_form(FL_NO_BOX, 340, 190);
obj = fl_add_box(FL_UP_BOX,0,0,340,190,"");
obj = fl_add_labelframe(FL_ENGRAVED_FRAME,10,10,320,170,"8 Sliders");
fdui->s[0] = obj = fl_add_slider(FL_VERT_SLIDER,15,45,30,130,"");
fl_set_object_lalign(obj,FL_ALIGN_TOP);
fl_set_object_callback(obj,slider_slider_cb,0);
fl_set_slider_bounds(obj, 100, 0);
fl_set_slider_value(obj, 0);
fdui->s[1] = obj = fl_add_slider(FL_VERT_SLIDER,55,45,30,130,"");
fl_set_object_lalign(obj,FL_ALIGN_TOP);
fl_set_object_callback(obj,slider_slider_cb,1);
fl_set_slider_bounds(obj, 100, 0);
fl_set_slider_value(obj, 0);
fdui->s[2] = obj = fl_add_slider(FL_VERT_SLIDER,95,45,30,130,"");
fl_set_object_lalign(obj,FL_ALIGN_TOP);
fl_set_object_callback(obj,slider_slider_cb,2);
fl_set_slider_bounds(obj, 100, 0);
fl_set_slider_value(obj, 0);
fdui->s[3] = obj = fl_add_slider(FL_VERT_SLIDER,135,45,30,130,"");
fl_set_object_lalign(obj,FL_ALIGN_TOP);
fl_set_object_callback(obj,slider_slider_cb,3);
fl_set_slider_bounds(obj, 100, 50);
fl_set_slider_value(obj, 50);
fdui->s[4] = obj = fl_add_slider(FL_VERT_SLIDER,175,45,30,130,"");
fl_set_object_lalign(obj,FL_ALIGN_TOP);
fl_set_object_callback(obj,slider_slider_cb,4);
fl_set_slider_bounds(obj, 100, 0);
fl_set_slider_value(obj, 0);
fdui->s[5] = obj = fl_add_slider(FL_VERT_SLIDER,215,45,30,130,"");
fl_set_object_lalign(obj,FL_ALIGN_TOP);
fl_set_object_callback(obj,slider_slider_cb,5);
fl_set_slider_bounds(obj, 100, 0);
fl_set_slider_value(obj, 0);
fdui->s[6] = obj = fl_add_slider(FL_VERT_SLIDER,255,45,30,130,"");
fl_set_object_lalign(obj,FL_ALIGN_TOP);
fl_set_object_callback(obj,slider_slider_cb,6);
fl_set_slider_bounds(obj, 100, 0);
fl_set_slider_value(obj, 0);
fdui->s[7] = obj = fl_add_slider(FL_VERT_SLIDER,295,45,30,130,"");
fl_set_object_lalign(obj,FL_ALIGN_TOP);
fl_set_object_callback(obj,slider_slider_cb,7);
fl_set_slider_bounds(obj, 100, 0);
fl_set_slider_value(obj, 0);
fdui->ts[0] = obj = fl_add_text(FL_NORMAL_TEXT,15,15,30,30,"");
fl_set_object_lsize(obj,FL_TINY_SIZE);
fl_set_object_lalign(obj,FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
fdui->ts[1] = obj = fl_add_text(FL_NORMAL_TEXT,55,15,30,30,"");
fl_set_object_lsize(obj,FL_TINY_SIZE);
fl_set_object_lalign(obj,FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
fdui->ts[2] = obj = fl_add_text(FL_NORMAL_TEXT,95,15,30,30,"");
fl_set_object_lsize(obj,FL_TINY_SIZE);
fl_set_object_lalign(obj,FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
fdui->ts[3] = obj = fl_add_text(FL_NORMAL_TEXT,135,15,30,30,"");
fl_set_object_lsize(obj,FL_TINY_SIZE);
fl_set_object_lalign(obj,FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
fdui->ts[4] = obj = fl_add_text(FL_NORMAL_TEXT,175,15,30,30,"");
fl_set_object_lsize(obj,FL_TINY_SIZE);
fl_set_object_lalign(obj,FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
fdui->ts[5] = obj = fl_add_text(FL_NORMAL_TEXT,215,15,30,30,"");
fl_set_object_lsize(obj,FL_TINY_SIZE);
fl_set_object_lalign(obj,FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
fdui->ts[6] = obj = fl_add_text(FL_NORMAL_TEXT,255,15,30,30,"");
fl_set_object_lsize(obj,FL_TINY_SIZE);
fl_set_object_lalign(obj,FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
fdui->ts[7] = obj = fl_add_text(FL_NORMAL_TEXT,295,15,30,30,"");
fl_set_object_lsize(obj,FL_TINY_SIZE);
fl_set_object_lalign(obj,FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
fl_end_form();

fdui->slider->fdui = fdui;

return fdui;
}
/*---------------------------------------*/

--==_Exmh_11253150760--

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/