Re: Font and Color



Heres is a small example that use the Pango Text Attribute Markup Language
Hope it can help you.
Regards.
Hugues.


#include <gtk/gtk.h>

int main( int   argc,
          char *argv[] )
{
  static GtkWidget *window = NULL;
  GtkWidget *label;

  /* Initialise GTK */
  gtk_init (&argc, &argv);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  g_signal_connect (G_OBJECT (window), "destroy",
      G_CALLBACK (gtk_main_quit),
      NULL);

  gtk_window_set_title (GTK_WINDOW (window), "Label");
  label = gtk_label_new ("");
  gtk_label_set_markup(GTK_LABEL(label), "<span font_desc=\"sans 10\">This
label using</span><span foreground=\"blue\" font_desc=\"fixed 22\"> Pango
markup</span> ");
  gtk_container_add (GTK_CONTAINER (window), label);
  gtk_widget_show_all (window);

  gtk_main ();

  return 0;
}




----- Original Message -----
From: "Luiz Rafael Culik Guimaraes" <culikr uol com br>
To: <gtk-list gnome org>
Sent: Friday, April 25, 2003 1:17 PM
Subject: Font and Color


> Dear Friends
>
> How can I can the Font and/or Color for an gtk_label
>
> Regards
> Luiz
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list




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