Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make a label bold in GTK+

Tags:

c

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 GtkLabels, 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");
like image 434
steveo225 Avatar asked Jul 11 '12 14:07

steveo225


1 Answers

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>");
like image 151
Frédéric Hamidi Avatar answered Sep 20 '22 00:09

Frédéric Hamidi