Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Gnome/tests/   (Gnome Linux Desktop Version 4.23.2©)  Datei vom 30.5.2026 mit Größe 1 kB image not shown  

Quelle  testcursor.c

  Sprache: C
 


#include <gtk/gtk.h>

static const char *names[] = {
  "none",
  "default",
  "help",
  "pointer",
  "context-menu",
  "progress",
  "wait",
  "cell",
  "crosshair",
  "text",
  "vertical-text",
  "alias",
  "copy",
  "move",
  "dnd-ask",
  "no-drop",
  "not-allowed",
  "grab",
  "grabbing",
  "n-resize",
  "e-resize",
  "s-resize",
  "w-resize",
  "ne-resize",
  "nw-resize",
  "sw-resize",
  "se-resize",
  "col-resize",
  "row-resize",
  "ew-resize",
  "ns-resize",
  "nesw-resize",
  "nwse-resize",
  "all-resize",
  "all-scroll",
  "zoom-in",
  "zoom-out"
};

static int count = 0;

static gboolean
change_cursor (GtkWidget     *window,
               GdkFrameClock *frame_clock,
               gpointer       unused)
{
  GtkWidget *label;
  char buffer[128];

  gtk_widget_set_cursor_from_name (window, names[count % G_N_ELEMENTS (names)]);
  count++;

  label = gtk_window_get_child (GTK_WINDOW (window));
  g_snprintf (buffer, sizeof (buffer), "%d", count);
  gtk_label_set_label (GTK_LABEL (label), buffer);

  return G_SOURCE_CONTINUE;
}

int
main (int argc, char *argv[])
{
  GtkWidget *window, *label;
  gboolean done = FALSE;
  guint change_cursor_id;

  gtk_init ();

  window = gtk_window_new ();
  gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
  gtk_window_set_default_size (GTK_WINDOW (window), 600400);

  label = gtk_label_new ("");
  gtk_window_set_child (GTK_WINDOW (window), label);

  change_cursor_id = gtk_widget_add_tick_callback (window, change_cursor, NULL, NULL);

  gtk_window_present (GTK_WINDOW (window));

  while (!done)
    g_main_context_iteration (NULL, TRUE);

  gtk_widget_remove_tick_callback (window, change_cursor_id);

  return 0;
}

Messung V0.5 in Prozent
C=100 H=89 G=94

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet am  2026-07-03) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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.