#!
import tools
import interact

from __main__ import Bonez
#
#{
state = 0
obj = self.get_init_arg ("obj")
kec = self.get_init_arg ("kec")
uo = self.get_init_arg ("uo")

print "restrincting", obj, kec

iface = interact.get_interaction (obj).get_iface (True)

def restrict_cb (self1, name):
    tools.tell (kec, 1)
    if uo: tools.unhide_cs_object (uo)
    iface.remove_restriction ("use_cb")
    self.set_env_var ("state", 1)
    return False

iface.set_restriction ("use_cb", restrict_cb)
#}!
#{
1, state
#}

