     win "delete-event" [ on-delete yield ]
     GtkWidget:delete-event connect-signal ;
 
-! ----------------------
-
 GENERIC: support-input-methods? ( gadget -- ? )
 GENERIC: get-cursor-surrounding ( gadget -- text cursor-pos )
 GENERIC: delete-cursor-surrounding ( offset count gadget -- )

    
    win world [ window-loc>> auto-position ]
    [ dim>> first2 gtk_window_set_default_size ] 2bi
    
    world setup-gl drop


    3drop ;

M: editor set-preedit-string
    3drop ;

M: editor get-cursor-loc&dim
    [ caret-loc ] [ caret-dim ] bi ;

: on-retrieve-surrounding ( im-context win -- ? )
    window world-focus dup support-input-methods? [
