Re: creating hypertext documents

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

 



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


[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux