diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2005-08-02 17:20:36 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2005-08-02 17:20:36 (GMT) |
commit | 6af7fe056387be32ff280f7e86d538ff9ea8c8e2 (patch) | |
tree | f7a20b03528224867b0d61489c62d8f47c446fef /Doc | |
parent | a2e21cb94592116b8dc9e4e5be63b69d2182edf9 (diff) | |
download | cpython-6af7fe056387be32ff280f7e86d538ff9ea8c8e2.zip cpython-6af7fe056387be32ff280f7e86d538ff9ea8c8e2.tar.gz cpython-6af7fe056387be32ff280f7e86d538ff9ea8c8e2.tar.bz2 |
Add example
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/whatsnew/whatsnew25.tex | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Doc/whatsnew/whatsnew25.tex b/Doc/whatsnew/whatsnew25.tex index 3b07b10..4bd380a 100644 --- a/Doc/whatsnew/whatsnew25.tex +++ b/Doc/whatsnew/whatsnew25.tex @@ -60,9 +60,21 @@ def log (message, subsystem): 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} |