Re: [gtk-list] Q: (gtk-entry) convert integer/float to char/string
- From: Owen Taylor <otaylor redhat com>
- To: dodger pool informatik rwth-aachen de
- Cc: "gtk-list redhat com" <gtk-list redhat com>
- Subject: Re: [gtk-list] Q: (gtk-entry) convert integer/float to char/string
- Date: 06 Apr 2000 09:13:20 -0400
Daniel Hops <Daniel.Hops@eed.ericsson.se> writes:
> Hello,
>
> in my gtk app I have to calculate digits (integers/floats) and want to
> insert them in entries via "gtk_entry_set_text ()".
> But this method only accepts chars. How can I easily make a function
> like itoa? Or is there another way?
char *str = g_strdup_printf ("%f", my_double);
gtk_entry_set_text (GTK_ENTRY (entry), str);
g_free (str);
Not the most efficient way, but easy and efficient enough.
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]