gtk How to highlight the next line of textview? -
i have highlight second line (arr[ii+1]). i'm tryng remove previous tag 2 iterators , add highlight new line others 1 :
sprintf(buffers,"%s",arr[ii]); if(cuno==0) { gtk_text_buffer_get_end_iter(buffer, &ei); gtk_text_buffer_insert(buffer, &ei, buffers, -1); gtk_text_buffer_get_end_iter(buffer, &ei); gtk_text_buffer_insert(buffer, &ei, "\n", -1); cuno++; } sprintf(buffers2,"%s",arr[ii+1]); gtk_text_buffer_create_tag(buffer, "gray_bg","background", "gray", null); gtk_text_buffer_get_end_iter(buffer, &ei2); gtk_text_buffer_get_end_iter(buffer, &ei); gtk_text_buffer_insert(buffer, &ei2, buffers2, -1); gtk_text_buffer_get_end_iter(buffer, &ei2); gtk_text_buffer_insert(buffer, &ei2, "\n", -1); gtk_text_buffer_get_start_iter(buffer, &si2); gtk_text_buffer_get_start_iter(buffer, &si); gtk_text_buffer_remove_all_tags(buffer,&si, &ei); gtk_text_buffer_apply_tag_by_name(buffer, "gray_bg",&si2, &ei2);
but on output text ever highlighted, can me?thank you
resolved one, thank :)
gtk_text_buffer_create_tag(buffer, "gray_bg","background", "green", null); gtk_text_buffer_get_iter_at_line(buffer,&si,ii+1); gtk_text_buffer_get_iter_at_line_offset (buffer,&ei2,ii+1,lstr); gtk_text_buffer_remove_tag_by_name (buffer,"gray_bg",&start,&end); gtk_text_buffer_apply_tag_by_name(buffer, "gray_bg",&si, &ei2);
Comments
Post a Comment