Re: turn on italics in TextView
On that last post, I think that I have some bad pointer arithmetic. Moving a pointer past the end and freeing a moved pointer. Not so good. Eric ... GSList *tlist=NULL; GSList *p=NULL; GSList *next=NULL; tlist=gtk_text_iter_get_tags(&start); p=tlist; if(tlist!=NULL) { do { next=p->next; gchar *string=NULL; g_object_get(G_OBJECT(p->data), "name", &string, 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"); if(tlist!=NULL) g_slist_free(tlist); ... -Original Message- From: Eric Cashon via gtk-app-devel-list To: dougm Cc: gtk-app-devel-list 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; GSList *next=NULL; tlist=gtk_text_iter_get_tags(&start); if(tlist!=NULL) { do { next=tlist->next; gchar *string=NULL; g_object_get(G_OBJECT(tlist->data), "name", &string, NULL); g_print("%s\n", string); g_free(string); tlist=g_slist_next(tlist); }while(next!=NULL); } else g_print("No Tags\n"); if(tlist!=NULL) g_slist_free(tlist); ... ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
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; GSList *next=NULL; tlist=gtk_text_iter_get_tags(&start); if(tlist!=NULL) { do { next=tlist->next; gchar *string=NULL; g_object_get(G_OBJECT(tlist->data), "name", &string, NULL); g_print("%s\n", string); g_free(string); tlist=g_slist_next(tlist); }while(next!=NULL); } else g_print("No Tags\n"); if(tlist!=NULL) g_slist_free(tlist); ... ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Find path under mouse
If I understand correctly, you want to get the x and y value of the mouse at the time when the keyboard event happens. You can either use GdkDeviceManager to get the pointer and then get x and y from that, or listen for motion_notify events on your treeview and keep track of x and y values (I think this may be what you mean by path). Anthony Ruth NASA Space Technology Research Fellow Condensed Matter Theory University of Notre Dame On Tue, Jun 20, 2017 at 1:21 AM, Daniel Kasak wrote: > Hi all. Reposting from the gtk-perl list ... no responses there ... > > Back in gtk+-2.x, I had some code that could find the path underneath > the mouse ( I was looking for double-click events in a treeview in > this case ): > > --- > > my ( $self, $treeview, $event ) = @_; > > if ( $event->type eq '2button-press' ) { > > # A double-click event > > if ( $event->window == $treeview->get_bin_window ) { > > my ( $path, $column, $cell_x, $cell_y ) = > $treeview->get_path_at_pos ( $event->x, $event->y ); > > --- > > Now I'm doing something similar in gtk+-3.x. I've set up an event > handler for keypress events, and I'm successfully catching the CTRL-C > keypress event. But I don't see immediately how to get the path / > position under the mouse ... > > Dan > ___ > gtk-app-devel-list mailing list > gtk-app-devel-list@gnome.org > https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list > ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list