Re: gtk_label_set_text

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

 



On Fri, 07 Jan 2005 12:51:11 -0500, Dean McCullough <dpmccul@xxxxxxxxxxx> wrote:
> I would like to use a label (or something similar) to provide feedback
> to the user on the current value of a parameter (level).
> 
> I would like to use code simular to the following:
> 
> char lab[10];
> sprintf(lab,"Level %d",level);
> gtk_label_set_text( GtkLabel *Llabel,
>                           lab);
> 
> However, this does not work, since the second parameter to
> gtk_label_set_text is type const char.
> 
> Any ideas of a simple way to accomplish this?

This is fine, "const" in gtk_label_set_text only ensures that
gtk_label_set_text wont modify your string, OTOH; you will
get compiler warnings if you have a "const gchar *" and pass it
to a function that takes "gchar *".

Cheers,
                                                  -Tristan
_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux