Make the label bold in GTK +

I'm just trying to make the text bold in GtkLabel . All I can find are examples for Python and C #. This is how I set up GtkLabel s right now, but I don’t know how to get them to render text in bold.

 GtkWidget* label = gtk_label_new("Text I want to be bold"); 
+6
source share
1 answer

An easy way is to call gtk_label_set_markup () , which takes the Pango Markup line:

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

Source: https://habr.com/ru/post/920228/


All Articles