# To subscribers of the xforms list from "j.w.c.a. lokin" <lokin@signaal.nl> :
Hi,
The program below illustrates (some of) the peculiarities of
fl_get_folder_area().
1) the behavior for all tabs is wrong although it differs for the
first and later calls: For the first, h seems to be too large,
and y seems ok, for later calls h seems ok and y seems too large.
2) closer inspection reveals that the claim that x and y are
relative to the top level form are not true, they appears
approx. twice as large.
Am I perhaps misinterpreting something?
I'm running 0.89 on Solaris 2.6.
-- -+- Jan Willem Lokin -+-#include <stdio.h> #include "forms.h"
#define butW 60 #define butH 15
static void add_tab (FL_OBJECT *folder, char *txt) { FL_FORM *form; FL_Coord x, y, w, h;
fl_get_folder_area (folder, &x, &y, &w, &h); fprintf (stderr, "x %d y %d w %d h %d\n", x, y, w, h); form = fl_bgn_form (FL_BORDER_BOX, w, h);
/* top left */ fl_add_box (FL_UP_BOX, x, y, butW, butH, txt); /* bottom_left, too low ?? */ fl_add_box (FL_UP_BOX, x, y + h - butH, butW, butH, txt); /* top right, too far right ?? */ fl_add_box (FL_UP_BOX, x + w - butW, y, butW, butH, txt); /* bottom_right, ?? */ fl_add_text (FL_UP_BOX, x + w - butW, y + h - butH, butW, butH, txt);
fl_end_form (); fl_addto_tabfolder (folder, txt, form); }
static void create_tabs () { const FL_Coord iw = 6 * butW, ih = 8 * butH, bw = 10; FL_FORM *form = fl_bgn_form (FL_FLAT_BOX, iw + 2 * bw, ih + 2 * bw); FL_OBJECT *folder = fl_add_tabfolder (FL_TOP_TABFOLDER, bw, bw, iw, ih, 0); fl_end_form ();
add_tab (folder, "Tab 1"); add_tab (folder, "Tab 2"); add_tab (folder, "Tab 3"); add_tab (folder, "Tab 4");
fl_show_form (form, FL_PLACE_FREE, FL_FULLBORDER, "Tabs"); }
int main (int argc, char *argv[]) { fl_initialize (&argc, argv, 0, 0, 0); create_tabs (); fl_do_forms (); fprintf (stderr, " *** Unexpected fallthru ***\n"); return 0; } _________________________________________________ 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://world.std.com/~xforms List Archive: http://bob.usuhs.mil/mailserv/list-archives/
This archive was generated by hypermail 2b29 : Fri Apr 07 2000 - 08:11:06 EDT