steveo225 steveo225 - 3 months ago 31
C Question

Make a label bold in GTK+

I am simply trying to make the text bold in a

GtkLabel
. All I can find are examples for Python and C#. Here is how I currently set up
GtkLabel
s, but I don't know how to make them render the text in bold.

GtkWidget* label = gtk_label_new("Text I want to be bold");

Answer

A simple way is to call gtk_label_set_markup(), which accepts a string of Pango markup:

GtkWidget *label = gtk_label_new(NULL);
gtk_label_set_markup(GTK_LABEL(label), "<b>Text to be bold</b>");
Comments