[Gtk-sharp-list] Gtk entry only for digits?

Philipp Kern phil@philkern.de
Sun, 29 Aug 2004 12:51:20 +0200


--=-up0PNJIMnSoqtUUi4zXN
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On So, 2004-08-29 at 09:41, Draek wrote:
> I'm sure that you can do it with KeyPressEventArgs. What I would do if I
> was you is print the key code that is received to the console when you
> press numbers you will see what the key code is, just do a switch
> statement on that keycode as a string and your set, only print the
> numbers not letters.

Although I really do not know how to reach an Entry field without alpha
characters, this hardware method doesn't seem very natural to me.
You get the hardware keycodes, so for providing proper editing features
you would also have to check the keypad (and if numlock is really on)
etc.

Perhaps you might want to play with "insert_text" and int
System.Int32.Parse(string).

Hope to help you just a little bit,
Philipp Kern

--=-up0PNJIMnSoqtUUi4zXN
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQBBMbUo7Ro5M7LPzdgRAn1tAKCORFqYAli/vXv2dfOpdYVPCOFKzACg46at
w/r3QpiNYURYi2OmYnvGZi8=
=eL92
-----END PGP SIGNATURE-----

--=-up0PNJIMnSoqtUUi4zXN--