Re: Is it possible to set marked up text for a button's label?



On Monday 22 November 2004 02:26, Dave Andruczyk wrote:

Is it possible with GTK+-2.4.x to create a checkbutton (or any button for
that matter) that has marked up text in it's label?

I want to create a series of checkbuttons but, for some of them I REALLY
want to use marked up text like "O<sub>2</sub> Voltage"

How does one do this?  The stock gtk_button_new_... commands don't have any
provisions for accepting markup.

A GtkButton is a GtkContainer, you can pack other widgets into it with 
gtk_container_add():

 cb = gtk_check_button_new ();
 label = gtk_label_new (NULL);
 gtk_label_set_markup (GTK_LABEL (label), markup);
 gtk_container_add (GTK_CONTAINER (cb), label);

Cheers
 -Tim



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