From: Andy S. <And...@co...> - 2010-10-22 22:12:54
|
diffing dir... Fri Oct 22 17:04:55 EDT 2010 Andy Stewart <laz...@gm...> * New GTK+2.22 function : entryImContextFilterKeypress Ignore-this: 1339f16a2711425195e42926285c3f9a { hunk ./gtk/Graphics/UI/Gtk/Entry/Entry.chs 85 +#if GTK_CHECK_VERSION(2,22,0) + entryImContextFilterKeypress, +#endif hunk ./gtk/Graphics/UI/Gtk/Entry/Entry.chs 152 -import Graphics.UI.Gtk.Gdk.EventM (EventM, EButton) +import Graphics.UI.Gtk.Gdk.EventM (EventM, EButton, EKey) +import Control.Monad.Reader ( ask ) +import Control.Monad.Trans ( liftIO ) hunk ./gtk/Graphics/UI/Gtk/Entry/Entry.chs 455 +#if GTK_CHECK_VERSION(2,22,0) +-- | Allow the 'Entry' input method to internally handle key press and release events. If this function +-- returns 'True', then no further processing should be done for this key event. See +-- 'imContextFilterKeypress'. +-- [_$_] +-- Note that you are expected to call this function from your handler when overriding key event +-- handling. This is needed in the case when you need to insert your own key handling between the input +-- method and the default key event handling of the 'Entry'. See 'textViewResetImContext' for +-- an example of use. +-- +-- * Available since Gtk+ version 2.22 +-- +entryImContextFilterKeypress :: EntryClass self => self -> EventM EKey Bool +entryImContextFilterKeypress self = do + ptr <- ask + liftIO $ liftM toBool $ + {# call gtk_entry_im_context_filter_keypress #} + (toEntry self) + (castPtr ptr) +#endif + } |