InterviewSolution
| 1. |
I Attach A Callback To A Signal, But I Keep Getting An Error: "typeerror: Object Of Type X Is Not Callable"? |
|
Answer» When connecting an event handler, you must provide the function name. A common mistake is to pass a call instead of the name. In other WORDS, you should not add parenthesis after the function name. # As you can see, gtk.main_quit() is a call, not the function name. The correct WAY to do it would be: # RIGHT ALWAYS remember to use gtk.main_quit() instead of gtk.mainquit() SINCE the last one is deprecated. When connecting an event handler, you must provide the function name. A common mistake is to pass a call instead of the name. In other words, you should not add parenthesis after the function name. # As you can see, gtk.main_quit() is a call, not the function name. The correct way to do it would be: # RIGHT Always remember to use gtk.main_quit() instead of gtk.mainquit() since the last one is deprecated. |
|