#include <gtk/gtk.h>

int main (int argc, char *argv[])
{
  GtkWindow *window;
  GtkWidget *entry;
  GtkWidget *box;
  GtkWidget *label;
  PangoAttrList *list;
  PangoAttribute *attr;

  gtk_init (&argc, &argv);

  list = pango_attr_list_new ();
  attr = pango_attr_foreground_alpha_new (0xFFFF * .5);
  attr->start_index = 0;
  attr->end_index = 4;
  pango_attr_list_insert (list, attr);

  window = g_object_new (GTK_TYPE_WINDOW,
                         "default-width", 400,
                         "default-height", 100,
                         "border-width", 24,
                         "title", "Test Window",
                         NULL);

  box = g_object_new (GTK_TYPE_BOX,
                      "orientation", GTK_ORIENTATION_VERTICAL,
                      "spacing", 24,
                      "visible", TRUE,
                      "vexpand", TRUE,
                      NULL);
  gtk_container_add (GTK_CONTAINER (window), box);

  entry = g_object_new (GTK_TYPE_ENTRY,
                        "text", "Some Text",
                        "visible", TRUE,
                        NULL);
  gtk_container_add (GTK_CONTAINER (box), entry);

  gtk_entry_set_attributes (GTK_ENTRY (entry), list);

  label = g_object_new (GTK_TYPE_LABEL,
                        "label", "Some Text",
                        "visible", TRUE,
                        NULL);
  gtk_container_add (GTK_CONTAINER (box), label);

  gtk_label_set_attributes (GTK_LABEL (label), list);

  g_signal_connect (window, "delete-event", gtk_main_quit, NULL);
  gtk_window_present (window);
  gtk_main ();

  return 0;
}
