Re: Text widget delete bug example




On 25-Feb-98 Owen Taylor wrote:
>>  if (numlines > 10) {
>>     gtk_text_freeze(GTK_TEXT(text));
>>     while( GTK_TEXT(text)->text[numchars] && 
>>            (GTK_TEXT(text)->text[numchars] != '\n') ) {
>>       numchars++;
> 
> This will get you into trouble. (Though it isn't the problem
> here) The text widget uses a gapped buffer, so just getting
> a character like that is wrong.

I am aware of the potential problems you mention, which is why I was
careful to avoid them :-)

I went for the easy hack.

Some functions for retrieving text would be good.

Thanks

Tony

(Redhat haven't located a clue as to why the software managing this
list has a vendetta against me yet).
--
E-Mail: Tony Gale <gale@daedalus.dra.hmg.gb>
A budget is just a method of worrying before you spend money, as well
as afterward.

The views expressed above are entirely those of the writer
and do not represent the views, policy or understanding of
any other person or official body.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]