/* Inserts a piece of text into the buffer, giving it the usual *appearanceofahyperlinkinawebbrowser:blueandunderlined. *Additionally,attachessomedataonthetag,tomakeitrecognizable *asalink.
*/ staticvoid
insert_link (GtkTextBuffer *buffer,
GtkTextIter *iter, constchar *text, int page)
{
GtkTextTag *tag;
/* Quick-and-dirty text-to-speech for a single word. If you don't hear *anything,youaremissingespeak-ngonyoursystem.
*/ staticvoid
say_word (GtkGestureClick *gesture,
guint n_press, double x, double y, constchar *word)
{ constchar *argv[3];
/* Fills the buffer with text and interspersed links. In any real *hypertextapp,thismethodwouldparseafiletoidentifythelinks.
*/ staticvoid
show_page (GtkTextView *text_view, int page)
{
GtkTextBuffer *buffer;
GtkTextIter iter, start;
GtkTextMark *mark;
GtkWidget *child;
GtkTextChildAnchor *anchor;
GtkEventController *controller;
GtkTextTag *bold, *mono, *nobreaks;
gtk_text_buffer_insert (buffer, &iter, "\n" "An attribute that can be applied to some range of text. For example, " "a tag might be called “bold” and make the text inside the tag bold.\n" "However, the tag concept is more general than that; " "tags don't have to affect appearance. They can instead affect the " "behavior of mouse and key presses, “lock” a range of text so the " "user can't edit it, or countless other things.\n", -1);
insert_link (buffer, &iter, "Go back", 1);
gtk_text_buffer_insert (buffer, &iter, "\n" "Machine-readable text that is not sequential but is organized " "so that related items of information are connected.\n", -1);
insert_link (buffer, &iter, "Go back", 1);
/* Looks at all tags covering the position of iter in the text view, *andifoneofthemisalink,followitbyshowingthepageidentified *bythedataattachedtoit.
*/ staticvoid
follow_if_link (GtkWidget *text_view,
GtkTextIter *iter)
{
GSList *tags = NULL, *tagp = NULL;
/* we shouldn't follow a link if the user has selected something */
gtk_text_buffer_get_selection_bounds (buffer, &start, &end); if (gtk_text_iter_get_offset (&start) != gtk_text_iter_get_offset (&end)) return;
staticvoid
motion_cb (GtkEventControllerMotion *controller, double x, double y,
GtkTextView *text_view)
{ int tx, ty;
gtk_text_view_window_to_buffer_coords (text_view,
GTK_TEXT_WINDOW_WIDGET,
x, y, &tx, &ty);
set_cursor_if_appropriate (text_view, tx, ty);
}
static gboolean hovering_over_link = FALSE;
/* Looks at all tags covering the position (x, y) in the text view, *andifoneofthemisalink,changethecursortothe"hands"cursor *typicallyusedbywebbrowsers.
*/ staticvoid
set_cursor_if_appropriate (GtkTextView *text_view, int x, int y)
{
GSList *tags = NULL, *tagp = NULL;
GtkTextIter iter;
gboolean hovering = FALSE;
if (!gtk_widget_get_visible (window))
gtk_widget_set_visible (window, TRUE); else
gtk_window_destroy (GTK_WINDOW (window));
return window;
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.13Bemerkung:
(vorverarbeitet am 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.