Re: XForms: drawing on my canvas with the mouse

AMIT BHATNAGAR (amit@cs.dal.ca)
Wed, 18 Feb 1998 16:50:19 -0400 (AST)

# To subscribers of the xforms list from AMIT BHATNAGAR <amit@cs.dal.ca> :

> My favorite thing is to just use a text object. Here's a little
> generic routine I use:
>
> #include <stdarg.h>
>
> [...]
>
> void readout( FL_OBJECT *obj, char *fmt, ... )
>
> {
>
> va_list list;
> char buffer[80];
>
> va_start( list, fmt );
>
> vsprintf( buffer, fmt, list );
>
> va_end( list );
>
> fl_set_object_label( obj, buffer );
>
> }
>
> So, I'd call it with from my motion handler as:
>
> readout( some_object, "%d,%d", x, y );

No matter what type of label assignment I choose in formdesigner, I get a
Xforms ERROR: Bad Allignment Request... and in my .c file I have :

obj = fl_add_text(FL_NORMAL_TEXT,750,20,80,40,"Text");
fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);

??? odd...

aside from this, I am having trouble understanding your readout function..
could you explain it a little?

_________________________________________________
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://bloch.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/