def apply(root,d,pos):
    """Creates interface for dictionnary d in root at given grid position """
    "TODO: repercuter kwargs"
    (x,y,w,h)= pos
    lbs= []    
    saisies= dict()    
    entries= dict()
    for (n,(k,v)) in enumerate(d.iteritems()):  
        assert (k not in saisies)        
        l= tk.Label(root,text=str(k))
        l.grid(row=n+x,column=y)               
        if isinstance(v,list):
            """value= list => multiple choice => use menubutton"""            
            #saisies[k]= tk.StringVar(name=str(n),value= str(v[0]))
            saisies[k]= tk.StringVar(value= str(v[0]))            
            ent=tk.Menubutton(root,textvariable=saisies[k],relief="sunken")
            ent.m=tk.Menu(ent,tearoff=0)
            ent.config(menu=ent.m)    
            for (kk,possible) in enumerate(v):             
                possibleSaved= "%s" %possible                 
                ent.m.add_command(label=str(possible), command= doLambda(updateMB,saisies[k],str(d[k][kk]) ) )
                print possible
        else:         
            """value is not a list => classical edit => use Entry""" 
            #saisies[k]= tk.StringVar(name=str(n),value= str(v))
            saisies[k]= tk.StringVar(value= str(v))   
            ent= tk.Entry(textvariable=saisies[k])#,width=30)
        ent.grid(row=n+x,column=y+1)     
        entries[k]= ent
    return saisies
Creates interface for dictionnary d in root at given grid position 
recipes/Python/577611_edit_dictionary_values_possibly_restrained/recipe-577611.py