Blame browser/jg_bind.ml

Packit bd2e5d
(*************************************************************************)
Packit bd2e5d
(*                                                                       *)
Packit bd2e5d
(*                         OCaml LablTk library                          *)
Packit bd2e5d
(*                                                                       *)
Packit bd2e5d
(*            Jacques Garrigue, Kyoto University RIMS                    *)
Packit bd2e5d
(*                                                                       *)
Packit bd2e5d
(*   Copyright 1999 Institut National de Recherche en Informatique et    *)
Packit bd2e5d
(*   en Automatique and Kyoto University.  All rights reserved.          *)
Packit bd2e5d
(*   This file is distributed under the terms of the GNU Library         *)
Packit bd2e5d
(*   General Public License, with the special exception on linking       *)
Packit bd2e5d
(*   described in file ../../../LICENSE.                                 *)
Packit bd2e5d
(*                                                                       *)
Packit bd2e5d
(*************************************************************************)
Packit bd2e5d
Packit bd2e5d
(* $Id$ *)
Packit bd2e5d
Packit bd2e5d
open Tk
Packit bd2e5d
Packit bd2e5d
let enter_focus w =
Packit bd2e5d
  bind w ~events:[`Enter] ~action:(fun _ -> Focus.set w)
Packit bd2e5d
Packit bd2e5d
let escape_destroy ?destroy:tl w =
Packit bd2e5d
  let tl = match tl with Some w -> w | None -> w in
Packit bd2e5d
  bind w ~events:[`KeyPressDetail "Escape"] ~action:(fun _ -> destroy tl)
Packit bd2e5d
Packit bd2e5d
let return_invoke w ~button =
Packit bd2e5d
  bind w ~events:[`KeyPressDetail "Return"]
Packit bd2e5d
    ~action:(fun _ -> Button.invoke button)