Re: [gtk-list] Re: Active URLs
- From: Raul Dias <chaos swi com br>
- To: gtk-list redhat com
- cc: Anders Melchiorsen <and kampsax dtu dk>, Ron Forrester <rjf zero-ping com>
- Subject: Re: [gtk-list] Re: Active URLs
- Date: Mon, 27 Sep 1999 14:14:12 -0300 (EST)
On 27 Sep, Anders Melchiorsen wrote:
> I ended up doing this in a simplistic way. I use the button_release
> event to see when the mouse is clicked in the widget and I then use
> the selection to figure out where it was clicked.
>
> If the selection starts and stops at different positions, I just
> ignore the event (since it was used to mark the selection and not
> because someone wanted to activate the URL).
>
> If the selection starts and stops at the same position, however, there
> is not really a selection. Then a simple matter of scanning the widget
> contents for URLs near that position will do the job.
>
> I do it by checking against a list of start-stop positions for URLs
> that I build when I display the widget (this works best with static
> content, I would think). I also color the discovered links red
> (couldn't quite figure out how to underline :-) when building that
> list but this is not required for a very simple implementation.
>
> I think it would be rather easy to implement this into GTK+ itself
> with some function to turn the URL discovering mode on/off and an
> extra event to deliver the clicked address to the application. But
> maybe one wants Gnome for that?
>
This is a good implementation. I am looking for a way to do the same
thing.
Does gnome has a widget for this?
-Raul Dias
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]