Re: creating hypertext documents



You can do basic hypertext pretty easily with a GtkTextView.
Use a tag to make the link blue and underlined, then
g_object_set_data the link target on that tag. Connect to
button release events (actually you'll probably find that
you need to connect to "event-after" and check that it's a
button release, otherwise an annoying problem comes up) and
look at the tags on the text where the click comes from. If
one of the tags has the link target in its
g_object_get_data, follow the link. Also, use motion notify
to see if the mouse is hovering over a link, and turn the
cursor into a hand. See gucharmap/gucharmap/gucharmap-charmap.c
for an example of how to do this.

Noah

On Thu, Jul 31, 2003 at 22:41:23 -0700, Shiraz Baig wrote:
> I have been searching for some hints, how can I create
> a hypertext document. If I use a text widget, I need
> to create a link and then the mouse should be able to
> reacognise that link.But the mouse movement is
> detectable only over widgets. Then shall I place the
> text on the widget?
> 
> Could somebody just give me a hint how to approach the
> problem?
> 1) Which widget should be used?
> 2) How would the mouse movement over the " hypertext
> link" be detected. 
> 3) How can the hypertext link be placed in a widget. 
> 
> Thanks
> shiraz



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