         ] [ gtk_dialog_run drop ] bi
     ] with-destructors ;
 
+: <yield-callback> ( -- callback )
+    [ drop yield t ] GSourceFunc ;
+
 M: gtk-ui-backend (with-ui)
     [
         0 gint <ref> f void* <ref> gtk_init

        init-clipboard
        start-ui
        [
            [ [ gtk_main ] with-timer ] with-event-loop
        ] with-destructors
    ] ui-running ;


    2drop window ungraft t ;

:: connect-win-state-signals ( win -- )
    win "expose-event" [ on-expose ]
    GtkWidget:expose-event connect-signal
    win "configure-event" [ on-configure ]
    GtkWidget:configure-event connect-signal
    win "delete-event" [ on-delete ]
    GtkWidget:delete-event connect-signal
    win "map-event" [ on-map ]
    GtkWidget:map-event connect-signal ;

! Input methods
