diff --git a/examples/gui_integration/python_editor.py b/examples/gui_integration/python_editor.py
index <HASH>..<HASH> 100755
--- a/examples/gui_integration/python_editor.py
+++ b/examples/gui_integration/python_editor.py
@@ -51,6 +51,8 @@ class PythonEditorWindow(QtGui.QMainWindow, Ui_MainWindow):
         self.setupStylesMenu()
         self.setupModesMenu()
         self.setupPanelsMenu()
+        self.editor.gotoAssignmentsMode.outOfDocument.connect(
+            self.onOutOfDocument)
         try:
             self.editor.openFile(__file__)
         except (OSError, IOError):
@@ -58,6 +60,12 @@ class PythonEditorWindow(QtGui.QMainWindow, Ui_MainWindow):
         except AttributeError:
             pass
 
+    def onOutOfDocument(self, definition):
+        QtGui.QMessageBox.warning(self, "Out of document",
+                                  "%s is defined out of the current document. "
+                                  "An IDE will typically open a new tab." %
+                                  definition.full_name)
+
     def setupStylesMenu(self):
         group = QtGui.QActionGroup(self)
         group.addAction(self.actionLight)
#<I> Add a message box in the example to show how to handle out of the document definition