[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XForms] New prerelease xforms-1.0.94pre13
From: |
Paul |
Subject: |
Re: [XForms] New prerelease xforms-1.0.94pre13 |
Date: |
Tue, 25 Dec 2012 09:20:00 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.28) Gecko/20120313 Thunderbird/3.1.20 |
After some investigation...
The problem is that a canvas object loses its window
ID after the sequence
fl_freeze_form();
fl_set_object_geometry( ...);
fl_unfreeze_form( form);
Here is a demo program
#include <stdio.h>
#include <forms.h>
int main( int argc, char *argv[])
{
fl_initialize( &argc, argv, "xftest", 0, 0);
FL_FORM *form = fl_bgn_form( FL_NO_BOX, 400, 300);
FL_OBJECT *dp =
fl_add_canvas( FL_NORMAL_CANVAS, 5, 5, 300, 200, "");
fl_end_form();
fl_show_form( form, FL_PLACE_FREE, FL_FULLBORDER, "xftest");
XSync( fl_get_display(), 0);
printf( "canvas window %d\n", (int) FL_ObjWin( dp));
printf( "paused, press ENTER to continue\n");
getchar();
// Now increase the canvas size to 350x250
fl_freeze_form( form);
fl_set_object_geometry( dp, 5, 5, 350, 250);
fl_unfreeze_form( form);
XSync( fl_get_display(), 0);
// Bug manifests as a zero return from FL_ObjWin
// But only if freeze/unfreeze is used.
printf( "canvas window %d\n", (int) FL_ObjWin( dp));
printf( "paused, press ENTER to continue\n");
getchar();
return 0;
}
$ gcc -Wall -o xftest xftest.c -lforms
The program prints the window handle before and after
the canvas size change. On pre10 and pre11, the
window ID changes, which is no problem:-
$ ./xftest
canvas window 341835836
paused, press ENTER to continue
canvas window 341835837
paused, press ENTER to continue
But on pre12 and pre13, the window ID becomes zero:-
$./xftest
canvas window 341835836
paused, press ENTER to continue
canvas window 0
paused, press ENTER to continue
The problem only occurs when freeze/unfreeze is used.
--
Paul Nicholson
--
- [XForms] New prerelease xforms-1.0.94pre13, Jens Thoms Toerring, 2012/12/08
- [XForms] New prerelease xforms-1.0.94pre13, R P Herrold, 2012/12/10
- Re: [XForms] New prerelease xforms-1.0.94pre13, Jens Thoms Toerring, 2012/12/19
- Re: [XForms] New prerelease xforms-1.0.94pre13, Serge Bromow, 2012/12/19
- Re: [XForms] New prerelease xforms-1.0.94pre13, Jens Thoms Toerring, 2012/12/19
- Re: [XForms] New prerelease xforms-1.0.94pre13, Paul, 2012/12/24
- Re: [XForms] New prerelease xforms-1.0.94pre13,
Paul <=
- Re: [XForms] New prerelease xforms-1.0.94pre13, Paul, 2012/12/25
- Re: [XForms] New prerelease xforms-1.0.94pre13, Jens Thoms Toerring, 2012/12/25
- Re: [XForms] New prerelease xforms-1.0.94pre13, Paul, 2012/12/25
- Re: [XForms] New prerelease xforms-1.0.94pre13, Jens Thoms Toerring, 2012/12/25