Re: text with links





----- Original Message ----
From: Paul Drynoff <pauldrynoff gmail com>
To: Lance Dillon <riffraff169 yahoo com>
Cc: gtk-app-devel-list gnome org
Sent: Wednesday, September 6, 2006 2:52:00 PM
Subject: Re: text with links



I would have to test this.  I think the gtk example does some anchors inline.

The last problem is, if you trys example, you see that
in line "aaa Link",
the "Link" and "aaa" is not on the same line,
can GtkTextView care about anchors automaticaly, or I should do it by my self?
I don't find API to get height of line in GtkTextView to resize button to it,
and interesting what happend if there are no text, only anchors on line,
is it climb on the next line?

--------
What I'm thinking is that the padding and margin and stuff of the button is adding to the height.  

Didn't work.

What might be better is draw regular lines with markup as needed (blue,underline), and connect to 
button-press-event.  Then, when the button is clicked on one of your links, check whether it was a single 
click, grab the x and y coordinate of the click, then use gtk_text_view_window_to_buffer_coords() (perhaps?) 
to find where in the buffer the mouse was clicked.  You can create a GtkTextTag that has the appropriate 
markup (blue, underline) called "link" or something, then test whether your tag is on for the location, using 
gtk_text_iter_get_toggled_tags.




That's just a quick suggestion.  It may be round about, but it may work.

Other people may have something better and/or easier.





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