#UI_ENHANCEMENT by cg
authorClaus Gittinger <cg@exept.de>
Wed, 31 Aug 2016 18:34:45 +0200
changeset 4057 9df077908336
parent 4056 de0810b2be05
child 4058 aa7a38bb1376
#UI_ENHANCEMENT by cg class: SerialPort added: #inspectorExtraMenuOperations
SerialPort.st
--- a/SerialPort.st	Wed Aug 31 16:23:05 2016 +0200
+++ b/SerialPort.st	Wed Aug 31 18:34:45 2016 +0200
@@ -346,6 +346,23 @@
     eolMode := nil.
 ! !
 
+!SerialPort methodsFor:'inspecting'!
+
+inspectorExtraMenuOperations
+    "extra operation-menu entries to be shown in an inspector.
+     Answers a collection of pairs contining aString and action aBlock.
+     aString is the label of the menu item.
+     aBlock is evaluated when the menu item is selected.
+     To be redefined in objects which think that it makes sense to offer
+     often used operations in an inspector.
+     See SerialPort as an example."
+
+    ^ super inspectorExtraMenuOperations
+    , {
+        { 'Close' . [:inst | inst close ] }
+    }
+! !
+
 !SerialPort methodsFor:'low level'!
 
 baudRate:newRate