You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/intro.rst
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,7 @@ You can unregister the callback later, either by using the name of the function,
113
113
A simple example
114
114
----------------
115
115
116
-
Let's register a callback for the FILESAVING event - the occurs just before the file is saved,
116
+
Let's register a callback for the FILEBEFORESAVE event - the occurs just before the file is saved,
117
117
and we'll add a "saved on" log entry to the end of the file, if the filename ends in '.log'.::
118
118
119
119
import datetime
@@ -132,7 +132,7 @@ Line 4 checks that the extension of the file is '.log'.
132
132
133
133
Line 5 appends text like ``"File saved on 2009-07-15"`` to the file.
134
134
135
-
Line 7 registers the callback function for the FILESAVING event. Notice the square brackets around the ``NOTIFICATION.FILESAVING``. This is a list, and can contain more than one item (so that the function is called when any of the events are triggered).
135
+
Line 7 registers the callback function for the FILEBEFORESAVE event. Notice the square brackets around the ``NOTIFICATION.FILEBEFORESAVE``. This is a list, and can contain more than one item (so that the function is called when any of the events are triggered).
136
136
137
137
Really, we should improve this function a little. Currently, it assumes the file being saved is the active document - in the case of using "Save All", it isn't necessarily. However, it's easy to fix...
138
138
@@ -182,7 +182,7 @@ The simplest form is::
182
182
183
183
This unregisters all callbacks for all events. If you want to just clear one or more events, just pass the list of :class:`NOTIFICATION` events you wish to clear.::
*Note that if you want to clear the callback for just one event, you still need to pass a list (i.e. surrounded with square brackets)*
188
188
@@ -191,7 +191,7 @@ To unregister a callback for a particular function, just pass the function.::
191
191
notepad.clearCallbacks(addSaveStamp)
192
192
193
193
194
-
To unregister a callback for a particular function, for particular events (perhaps you want to keep the function registered for FILESAVING, but don't want FILESAVED anymore)
194
+
To unregister a callback for a particular function, for particular events (perhaps you want to keep the function registered for FILEBEFORESAVE, but don't want FILESAVED anymore)
0 commit comments