Re: What is the meaning of toggle on/off for GtkTextTags?



Hello.

The way I would interpret those function calls would be:

gtk_text_iter_forward_to_tag_toggle (iter, NULL);
  - Move iter to the start or end of any tag that comes next in buffer. If no
    tag start or end is found, move to the end of the buffer.

gtk_text_iter_forward_to_tag_toggle (iter, mytag);
  - Move iter to the start or end of mytag tag that comes next in buffer. If
    mytag is not present in buffer contents after initial iter, move to the end
    of the buffer.

Exactly the same thing applies for backward function. The only things that
changes is search direction.

Take this piece of markup as an example:
This is <em>important</em> piece of <b>bold and <c>colored</c></b> text.

Let say that our initial position is at character 'r' inside word 'important'.
gtk_text_iter_forward_to_tag_toggle (iter, NULL) call would move iter to </em>.
gtk_text_iter_forward_to_tag_toggle (iter, b) call would move iter to <b>.
gtk_text_iter_forward_to_tag_toggle (iter, x) call would move iter to the end.

(I substituted GtkTextTab with simple name in function calls from didactic
reasons.)

Hopefully things are clearer now.

Tadej

--
Tadej Borovšak
tadeboro.blogspot.com
tadeboro gmail com
tadej borovsak gmail com


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