tframe.bind(DGG.B1PRESS, foos) problem

def foos(): 
    print "hello"

tframe = DirectFrame(pos=(-.5,0,0), frameSize=(-.2,.2,-.2,.2), state=DGG.NORMAL) 
tframe.bind(DGG.B1PRESS, foos)

results in:

TypeError: foos() takes no arguments (1 given) ?

try:

def foos(arg): 
    print "i was given",arg,"of type",type(arg)
    print "hello" 

tframe = DirectFrame(pos=(-.5,0,0), frameSize=(-.2,.2,-.2,.2), state=DGG.NORMAL) 
tframe.bind(DGG.B1PRESS, foos)

It should become clear.

1 Like

Thanks. I got:

which is kinda cool.