I am trying to create a text box in GTK+3.0 (using C, in Linux) that can be read from as a double, where this double will be plugged into an equation and then returned in a different box.
So my question is: what is the best way to create a text box that can be typed into, and then how do I read it as a double?
I am currently trying to use gtk_entry_new()
to initialize and - after a few intermediary steps - *gtk_entry_get_text
to read.
My read line currently looks like this:
double y = (double)*gtk_entry_get_text(GTK_ENTRY(input_y));
I keep getting y as a pointer, and the *gtk_entry_get_text(...)
is of format const gchar*
I believe the best way is to convert const gchar*
into double
, but how?