Re: turn on italics in TextView

2017-08-30 Thread Eric Cashon via gtk-app-devel-list
Hi Doug, I would consider it a usability bug but not necessarily a textview widget bug. If you add text, that doesn't have an indent tag, to the start of the line then it doesn't get indented. I suppose you could check the whole line for an indent tag but that would go against performance.

Re: turn on italics in TextView

2017-08-29 Thread Doug McCasland
Indeed I tried your code from Aug 15 and if you insert a character at the beginning of the 3rd or 5th line, the indent/margin disappears. Then if you backspace over that inserted character, the indent/margin re-appears. I tried this in <3.20 and 3.22. Would you consider this a bug? I've never

Re: turn on italics in TextView

2017-08-15 Thread Doug McCasland
Indeed, gtk_text_buffer_insert_with_tags_by_name() does what it says. What I was talking about was (in some future Textview) applying the tag to an iter, then whenever the insert point was on that iter, it would inherit the tag properties set there. So typing at that point gets the formatting.

Re: turn on italics in TextView

2017-08-15 Thread Eric Cashon via gtk-app-devel-list
Have you tried gtk_text_buffer_insert_with_tags_by_name() to insert text with a tag at an iter? What tag combo do you use to get the cursor to bounce around? If I test having two indent tags on the same line, the first one applied wins out. This is what I tested with. Eric /* gcc -Wall

Re: turn on italics in TextView

2017-08-15 Thread Doug McCasland
Heh-heh, yes that for loop does look better :-) I'll use that. Textview is awesome and will save me thousands of lines of code, but not being able to apply a tag to an iter -- that has been a big drawback for me. You can discover a tag at an iter, but only apply/remove it to a range. It would

Re: turn on italics in TextView

2017-08-15 Thread Eric Cashon via gtk-app-devel-list
Hi Doug, I made a bit of a pointer mess there. Not the best of answers or way to go about iterating through a list. Looking at some GTK code, this is better done with a for loop. As usual, you don't want to move the pointer you get from gtk_text_iter_get_tags() and then free it. This will

Re: turn on italics in TextView

2017-08-15 Thread Doug McCasland
object_get(G_OBJECT(p->data), "name", , NULL); > g_print("%s\n", string); > g_free(string); > if(next!=NULL)p=g_slist_next(p); > }while(next!=NULL); >} > else g_print("No Tag\n"); > >

Re: turn on italics in TextView

2017-06-20 Thread Eric Cashon via gtk-app-devel-list
@gnome.org> Sent: Tue, Jun 20, 2017 4:48 pm Subject: Re: turn on italics in TextView Another option is to look at the properties of the tags to get the information that you need. This might work better than saving globals and matching pointers. Eric ... GSList *tlist=NULL;

Re: turn on italics in TextView

2017-06-20 Thread Eric Cashon via gtk-app-devel-list
Another option is to look at the properties of the tags to get the information that you need. This might work better than saving globals and matching pointers. Eric ... GSList *tlist=NULL; GSList *next=NULL; tlist=gtk_text_iter_get_tags(); if(tlist!=NULL) { do

Re: turn on italics in TextView

2017-06-19 Thread Doug McCasland
gets re-painted. > > https://developer.gnome.org/gtk3/stable/chap-drawing-model.html > > Eric > > > > -----Original Message- > From: Doug McCasland <do...@bravoecho.net> > To: cecashon <cecas...@aol.com> > Sent: Tue, Jun 13, 2017 4:09 pm > Subject: Re: tur

Re: turn on italics in TextView

2017-06-14 Thread Eric Cashon via gtk-app-devel-list
From: Doug McCasland <do...@bravoecho.net> To: cecashon <cecas...@aol.com> Sent: Tue, Jun 13, 2017 4:09 pm Subject: Re: turn on italics in TextView cecashon, thanks so much for your great reply! I had tried all those calls, but I hadn't put them together as you did, nor did I apply t

Re: turn on italics in TextView

2017-06-13 Thread Eric Cashon via gtk-app-devel-list
Hi Doug, You can try using the "insert-text" callback to set your italics on the inserted text. This is what I came up with to test. The signal is connected after so that the update occurs first. Careful about not changing the location iter also since there is a warning in the documentation

turn on italics in TextView

2017-06-12 Thread Doug McCasland
Hi, I am trying GTK3 TextView, in C. I know how to apply tags, such as italics, bold, etc., to a region of text. But how do I "turn on" a style (italics, bold, etc) while typing in the buffer? For example, suppose I am typing text and there are no styles set. Then I want to type in italics. I