Re: Bring a widget to the foreground
- From: jcupitt gmail com
- To: Jaroslav ÅmÃd <jardasmid gmail com>
- Cc: gtk-app-devel-list <gtk-app-devel-list gnome org>
- Subject: Re: Bring a widget to the foreground
- Date: Tue, 4 Jan 2011 22:57:58 +0000
I agree, I was just trying to keep it simple.
On Tuesday, 4 January 2011, Jaroslav ÅmÃd <jardasmid gmail com> wrote:
Don't do that. Fixed size buffers are evil for string formatting. You better use g_strdup_printf even
though this would lead to reallocations. But much better then end up with cropped text.
On 01/02/2011 10:00 PM, jcupitt gmail com wrote:
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
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]