i'm getting this warning if I append text (setattribute APPEND) to a
IupText with multiline=YES, when handling a callback to ACTION (a simple
letter-key press will do).
i have been getting this warning randomly along with an application crash
(even some stack dumps) in a local network chat program that makes heavy
use of forrmatting and text-appending and just reduced it to this little
piece of code.
Pressed letter has also a weird behavior, it places itself at start of the
line above the last one if cursor/caret happens to be in the last line
Warning text:
Gtk-WARNING **: Invalid text buffer iterator: either the iterator is
uninitialized, or the characters/pixbufs/widgets in the buffer have been
modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a
position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that
can be referred to by character offset)
will invalidate all outstanding iterators
Example code:
#include <iup.h>
#include <stdio.h>
int append(Ihandle* self){
IupSetStrAttribute(self, "APPEND", "TEXT");
return IUP_DEFAULT;
}
int main(int argc, char* argv[]){
IupOpen(&argc, &argv);
Ihandle* win, * text;
text = IupText(NULL);
win = IupDialog(text);
IupSetAttribute(text, "MULTILINE", "YES");
IupSetAttribute(text, "EXPAND", "YES");
IupSetCallback(text, "ACTION", (Icallback)append);
IupShow(win);
IupMainLoop();
IupClose();
return 0;
}
Sorry for interrupting holidays (If Antonio is reading this).
Regards, Ariset
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users