Re: char distance between two GtkTextMarks?
- From: Havoc Pennington <hp redhat com>
- To: Joshua N Pritikin <vishnu pobox com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: char distance between two GtkTextMarks?
- Date: 26 Aug 2001 12:34:58 -0400
Joshua N Pritikin <vishnu pobox com> writes:
What is the recommended way to calculate the number of characters between
two GtkTextMarks?
i can loop with gtk_text_iter_forward_chars, but isn't this slow?
Is there a GtkTextIter API which i have overlooked?
buffer_get_iter_at_mark (buffer, &iter1, mark1);
buffer_get_iter_at_mark (buffer, &iter2, mark2);
pos1 = iter_get_offset (&iter1);
pos2 = iter_get_offset (&iter2);
chars_between = ABS (pos2 - pos1);
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]