Julien Nadeau
Wed, 10 Jun 2009 18:02:37 -0700
On Wed, Jun 10, 2009 at 11:17:26PM +0000, Chris wrote: > I have a chat box example that I need help with. > > I have a chat box submit text to another disabled chat box in order to display > the chat. The problem is, when I use AGAR's printf function, it overwrites the > buffer, therefore deleting previous messages. How can I save previous messages > in the buffer and display the new ones as well?
Why not use something like this:
char *buffer;
size_t buffer_size;
AG_Textbox *tb;
...
tb = AG_TextboxNew(parent, AG_TEXTBOX_MULTILINE, NULL);
AG_TextboxBindUTF8(tb, buffer, buffer_size);
Then you can simply append to the buffer:
strlcat(buffer, "foo", buffer_size);
_______________________________________________
Agar mailing list
Agar@hypertriton.com
http://libagar.org/lists.html