>
> > How do i retreive the value from an Fl_Int_Input and assign=20
> > it to my variable? I notice that the value() member still=20
> > reads the input as a char string, so i will need to convert=20
> > this manually, or is there another way provided to retrieve=20
> > the value as an integer?
>
> No, you need to use strtol() or similar on the string.
>
> We don't do it automatically as it is not always obvious what radix the
> number is meant to be, but allowing the user to convert it via strtol()
> allows them to get the result they want.
>
> Note that I'd caution against using atoi() or something simple like that
> as it gives less control over the conversion applied, and does not check
> for errors as robustly as strtol() in general.
>
> > I thought that the Fl_Int_Input would provide an integer, but=20
> > i see it is named as that because it refuses any other input.
>
> Indeed.
>
> > Aside from this initial validation. do the Fl_Input types=20
> > require manual validation for the amount of characters=20
> > entered and/ or range for ints or floats? or again is there a=20
> > native feature for this?
>
> If you want some specific validation, you need to do this yourself.
> Again, it's the same problem really; when presented with a string of
> digits, the fltk lib will not necessarily be able to determine, for a
> given app on a given host platform or numeric radix, whether that's a
> "valid" numeric string or not.=20
> The app knows what "number" would be valid for any given input however
> (I assume!) so it is best that the app do the check itself.
>
>
>
Thanks for that, i am well set now, yes it makes sense for the app to be 
responsible for most validation, after all it is a 'light' toolkit, i would 
rather have that than a gig worth of bloat to mess with!

Cheers.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to