Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23280 Modified Files: whatsnew25.tex Log Message: Add example Index: whatsnew25.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew25.tex,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- whatsnew25.tex 2 Aug 2005 17:13:21 -0000 1.15 +++ whatsnew25.tex 2 Aug 2005 17:20:36 -0000 1.16 @@ -60,9 +60,21 @@ server_log = functional.partial(log, subsystem='server') \end{verbatim} -Here's another example, from a program that uses PyGTk. +Here's another example, from a program that uses PyGTk. Here a +context-sensitive pop-up menu is being constructed dynamically. The +callback provided for the menu option is a partially applied version +of the \method{open_item()} method, where the first argument has been +provided. -% XXX add example from my GTk programming +\begin{verbatim} +... +class Application: + def open_item(self, path): + ... + def init (self): + open_func = functional.partial(self.open_item, item_path) + popup_menu.append( ("Open", open_func, 1) ) +\end{verbatim} \begin{seealso}