GTK widget for floating-point scientific notation
My spare-time project (C++/GTK+ 2.24/gtkmm) has a couple of configuration fields where the user can enter a floating-point number. The expected range is from 10^-15 through to 1.0, with no restrictions on the mantissa.

At the moment I am expecting the user to enter the number as either a decimal or in scientific notation in a single Entry (text field), which I parse with `iostream`. This works just fine, but I can't help thinking there must be a better way.

I've tried building my own composite widget with a text field for the mantissa and a SpinButton for the exponent, but it somehow doesn't feel _right_. An HScale for the mantissa and a SpinButton for the exponent might work, but it seems to prevent the user from specifying a precise value. Having some combination of widgets linked to an Entry would allow that, but seems even clunkier.

What have I missed? How would you accept arbitrary floating-point values from the user? 

In case it matters, at the moment the underlying data type is `double`, but I might implement arbitrary precision later. The application is not required to update immediately these values are changed - they are in a parameters dialog and only acted on when the user presses OK.
GTK widget for floating-point scientific notation
===

My spare-time project (C++/GTK+ 2.24/gtkmm) has a couple of configuration fields where the user can enter a floating-point number. The expected range is from 10^-15 through to 1.0, with no restrictions on the mantissa.

At the moment I am expecting the user to enter the number as either a decimal or in scientific notation in a single Entry (text field), which I parse with `iostream`. This works just fine, but I can't help thinking there must be a better way.

I've tried building my own composite widget with a text field for the mantissa and a SpinButton for the exponent, but it somehow doesn't feel _right_. An HScale for the mantissa and a SpinButton for the exponent might work, but it seems to prevent the user from specifying a precise value. Having some combination of widgets linked to an Entry would allow that, but seems even clunkier.

What have I missed? How would you accept arbitrary floating-point values from the user? 

In case it matters, at the moment the underlying data type is `double`, but I might implement arbitrary precision later. The application is not required to update immediately these values are changed - they are in a parameters dialog and only acted on when the user presses OK.