Re: [gtkmm] Key Snooping / Key_Press_Event Howto?



>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]