I tried to do that and changed the test/input.cxx file to swap the
TextBuffer of the TextEditor widget with every button press.
If you don't enter text but just press the button the program segfault
after some clicks.
If you enter text, then change the buffer, than enter text into the new
buffer the program at once segfaults. Is this a known bug?
I get this messages when just changing the buffer without entering text;
--------------------------------------------------------------------------------------------
TextBuffer::remove_modify_callback(): Can't find modify CB to remove
TextBuffer::remove_predelete_callback(): Can't find pre-delete CB to
remove
segfault
------------------------------------------------------------------------------------------------------
cheers,
Michael
this is the patch to get my version of input.cxx:
--- input.cxx 2007-05-09 20:40:56.754857488 +0200
+++ input-buf.cxx 2007-05-09 20:40:48.413130071 +0200
@@ -62,7 +62,13 @@
}
}
+fltk::TextBuffer* tb = new fltk::TextBuffer();
+
void button_cb(Widget *,void *) {
+ fltk::TextBuffer* t = editor->buffer();
+ editor->buffer(tb);
+ tb = t;
+ redraw();
for (int i=0; i<5; i++) test(input[i]);
if (editor->changed()) {
editor->clear_changed();
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk