Re: XForms: Pixmaps need callbacks ?

Matthew Flax (flatmax@cse.unsw.EDU.AU)
Thu, 14 Aug 1997 17:33:09 +1000 (EST)

To subscribers of the xforms list from Matthew Flax <flatmax@cse.unsw.EDU.AU> :

On Tue, 12 Aug 1997, Steve Lamont wrote:

> To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :
>
> > I discovered that I was initialising the gui form as static, this was the
> > problem.
>
> Positively bizarre!
>
> Can you give a short example piece of code which produces this
> behavior. I'm not sure why the storage type should make the slightest
> difference.
>

Yep ! ...
You were right - I tried it again and found it didn't matter wether it was
static or not, it still returns the errors.

Basicall the program is in C++, but a brief outline of what the program
does is like so:
i] Initialise the form.
ii] Define a callback :
updateMSsecond(FL_OBJECT *obj, long data){
ThisClass *me = GetThis(obj); //Needed for c++ see contrib
fl_set_pixmap_pixmap(obj, me->pix2);
}
ii] Load Pixmap_file1 :
fl_set_pixmap_file(fd_TCGui->MSsecond, "Pixmap_file1");
pix = fl_get_pixmap_pixmap(fd_TCGui->MSsecond, ......);
fl_set_pixmap_file(fd_TCGui->LSsecond, "Pixmap_file2");
pix2 = fl_get_pixmap_pixmap(..........);
NOTE: This works well, the pixmaps are loaded and displayed in
their respective objects. For example if I now call :
fl_call_object_callback(fd_TCGui->MSsecond);
Then pix2 is displayed in the MSsecond object ! wow thats beautiful ...

However if I do the old :
fl_do_forms();

and then try to do the:
fl_call_object_callback(fd_TCGui->MSsecond);
then it doesn't work and returns the following error :
Xlib: unexpected async reply (sequence 0x17c)!

Note: I know it enters the callback as I usually have a cout or printf
statement which says something like "updating MSsecond" in the callback.

I'm wondering if thre is another way of updating a pixmap object, although
these methods work before control is passed to the fl_do_forms() loop, I
really need the pixmaps to be updated during the fl_do_forms loop.

Thanks alot
Matt

_________________________________________________
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/