Re: [gtkmm] Key Snooping / Key_Press_Event Howto?
- From: Paul Davis <paul linuxaudiosystems com>
- To: Jeff Gavin <jeff ezclick net>
- Cc: "Andrew E. Makeev" <andrew solvo ru>, "'gtkmm-list'" <gtkmm-list gnome org>
- Subject: Re: [gtkmm] Key Snooping / Key_Press_Event Howto?
- Date: Thu, 19 Jun 2003 16:14:51 -0400
>bool my_class::on_my_entry_key_press_event (GdkEventKey* event)
>{
> const static Glib::ustring s = "0123456789";
> return (gint(s.find(event->string)) == -1);
>}
this approach is severely deprecated in an age of
internationalization. you should instead do this:
switch (ev->keyval) {
case GDK_0:
case GDK_1:
...
case GDK_9:
return true;
default:
return false;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]