Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8662993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:52:19+00:00 2026-06-12T16:52:19+00:00

i have a textview with a text buffer. i have added many tags to

  • 0

i have a textview with a text buffer.
i have added many tags to the text buffer with

buffer.get_tag_table().add(tag)

So i was wondering if there was a way to get all the text from the text view and split it according to the tag it has

im using gtk 2 btw

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T16:52:20+00:00Added an answer on June 12, 2026 at 4:52 pm

    Start with the iterator at beginning of buffer and move through the buffer with it.forward_to_tag_toggle(). At each point, it.get_tags() will give you a list of tags that apply to the current chunk of text, and buf.get_text(it, next_it) will give you the text itself:

    def split(buf):
        it = buf.get_start_iter()
        while not it.is_end():
            nextpos = it.copy()
            nextpos.forward_to_tag_toggle(None)
            yield buf.get_text(it, nextpos), it.get_tags()
            it = nextpos
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a TextView that has text Dynamically Added to it. My problem is
I have a textView and text like This is the Simple Text with KeyWord
Is it possible to have a TextView object containing text of two sizes? We
I have a TextView which i set the text using setText(). In properties, I
I have a ScrollView and a very long text on TextView and I want
I have a dynamic size RelativeLayout containing TextView with a arbitrary text. Also i
I have a custom Dialog that contains only a TextView to display some text
In a Custom ListView i have a TextView whose Text must change periodically every
I have a textView with some text in it. I want to delete the
i have a textview and imageview inside a linearlayout. textview containes more text so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.