Re: Bring a widget to the foreground



On 2 January 2011 15:39, John Emmas <johne53 tiscali co uk> wrote:
To be honest, all I'm trying to do is create a button whose label font can be changed on demand.  I've 
managed to achieve it by using an empty button with a label on top, except that the label doesn't always 
stay on top!

Ah, OK, yes, there's a much simpler technique.

Try something like this:

  txt = "some text to display";
  font = "sans 12";

  snprintf (button_text, 256,
     "<span font_desc=\"%s\" size=\"medium\">%s</span>",
     font, txt);
  gtk_label_set_markup (
    GTK_LABEL (gtk_bin_get_child (GTK_BIN (button))),
    button_text);

Assuming 'button' is a regular gtk button containing a label.

John



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