 GENERIC: support-input-methods? ( gadget -- ? )
 GENERIC: get-cursor-surrounding ( gadget -- text cursor-pos )
 GENERIC: delete-cursor-surrounding ( offset count gadget -- )
-GENERIC: set-preedit-string ( str cursor-pos gadget -- )
 GENERIC: get-cursor-loc&dim ( gadget -- loc dim )
 
 M: gadget support-input-methods? drop f ;

    dup editor-caret first2 [ swap editor-line ] dip ;

M: editor delete-cursor-surrounding
    3drop ;

M: editor set-preedit-string
    3drop ;

M: editor get-cursor-loc&dim

    GtkIMContext:retrieve-surrounding win connect-signal-with-data
    im "delete-surrounding" [ on-delete-surrounding yield ]
    GtkIMContext:delete-surrounding win connect-signal-with-data

    win "key-press-event" [ im-on-key-event yield ]
    GtkWidget:key-press-event im connect-signal-with-data
