Re: How to enter a floating-point number ?
- From: Tristan Van Berkom <vantr touchtunes com>
- To: Gan3sh <gan3sh wanadoo fr>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: How to enter a floating-point number ?
- Date: Wed, 26 May 2004 16:16:16 -0400
Gan3sh wrote:
Hi,
I would like to add a widget in my application to be able to enter a
floating-point number and only that.
If I use a GtkEntry, I didn't see in the doc how to restrict the
available characters to only digits (and also . + -).
And if I use a GtkSpinButton, I didn't see how to set the arrows
unvisible.
Is there another widget for entering only a number ?
Hmmm,
I dont think this should be in the gtk+ domain.
Why not just use a GtkEntry and use string conversion utilities
(i.e. isdigit() or some varient) ?
You can preemptivly deny some charachters input by catching
the GdkEventKey's (i.e. "key-press-event" on the GtkWidget object)
in advance and returning TRUE if you dont want that key to be
processed (i.e. if you dont want the GtkEntry's handler to be called).
Cheers,
-Tristan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]