OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [libgui/] [library/] [topbind.tcl] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# topbind.tcl - Put a binding on a toplevel.
2
# Copyright (C) 1997 Cygnus Solutions.
3
# Written by Tom Tromey <tromey@cygnus.com>.
4
#
5
# Put a binding on a toplevel.  This needs a separate proc because by
6
# default the toplevel's name is put into the bindtags list for all
7
# its descendents.  Eg Destroy bindings typically don't want to be run
8
# more than once.
9
#
10
 
11
# FIXME: should catch destroy operations and remove all bindings for
12
# our tag.
13
 
14
# Make the binding.  Return nothing.
15
proc bind_for_toplevel_only {toplevel sequence script} {
16
  set tagList [bindtags $toplevel]
17
  set tag _DBind_$toplevel
18
  if {[lsearch -exact $tagList $tag] == -1} then {
19
    # Always put our new binding first in case the other bindings run
20
    # break.
21
    bindtags $toplevel [concat $tag $tagList]
22
  }
23
 
24
  # Use "+" binding in case there are multiple calls to this.  FIXME
25
  # should just use gensym.
26
  bind $tag $sequence +$script
27
 
28
  return {}
29
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.