Closed SimplySeth closed 4 years ago
@SimplySeth have you made any progress with this? I'm having trouble with FunctionItem calls as well. I'm not even totally sure my function callbacks (or whatever it's appropriate to call them) are executing
cheers
@SimplySeth have you made any progress with this? I'm having trouble with FunctionItem calls as well. I'm not even totally sure my function callbacks (or whatever it's appropriate to call them) are executing
cheers
actually, I gave up. I was never able to figure it out.
One crazy issue I ran into was that because the menu system is threaded (still not sure about the advantage there) it means that if you pass a string as the args
value it interprets each character as a separate argument!
I had to explicitly set each FunctionItem() argument and wrap the args value to pass a tuple that the threaded call would parse correctly. It took me a lot of head scratching to sort that out.
thisSubmenuItem = FunctionItem(text=f, function=downloadSelectedFile, args=(f,), kwargs=argDict)
If you try this, don't forget the ,
after your parentheses!
myTuple=('tupleString'),
Cheers
I wondered the same thing. Put something like input('Press Enter to continue')
at the end of the function, and then the output will stay around.
I can see that there is a way to call a function with
FunctionItem
, but how I quite can't figure out how to get the output of the function I call.