Re: Please help changing text in text box

Steve Lamont (spl@szechuan.ucsd.edu)
Tue, 8 Apr 97 14:01:29 PDT

To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> I am trying to change the text of a text box dynamically
> (well really just once at setup time) but I keep getting core
> dumps. I don't want to put the full text of the box into the label
> from within fdesign (it will be several lines long, and I don't know
> how to enter multi-line labels in fdesign for one thing), ...

Enter the newlines with the '\n' character.

> ... but when I
> try to dirly set the "->label" element of the textbox object to
> point to my new string constant, the application core dumps if the
> string contains any embedded newlines or \n characters. The manual
> says I should be able to do this, so I am a little confused...

How are you doing this?

fl_set_object_label( fd_try->text,
"Hello\nWorld\nfoo\nbar\nbaz\nwoof" );

works for me.

Some questions in no particular order which may help you or others
determine the source of the problem:

What version of XForms are you running? What OS & hardware? X11
version? Can you run it under the debugger and get a traceback? How
many lines are you trying to write? Are you sure you're writing to a
valid object? Can you create a simple test program which replicates
the error? Have you tried just writing a single line of text
terminated by a newline? What happens then?

spl
_________________________________________________
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/xforms-archive/