UIPainterView.st
changeset 1069 7196ca547f5d
parent 1060 0332a41de5c5
child 1084 5b46f277b3e1
--- a/UIPainterView.st	Fri Mar 19 22:02:01 1999 +0100
+++ b/UIPainterView.st	Fri Mar 19 22:07:28 1999 +0100
@@ -699,7 +699,7 @@
      - but do not overwrite existing ones.
      Return a string ready to compile into the application class."
 
-    |cls code skip menuSelector protoSpec thisCode
+    |cls code skip protoSpec thisCode
      definedMethodSelectors iVars t|
 
     definedMethodSelectors := IdentitySet new.
@@ -717,7 +717,7 @@
     ].
 
     treeView propertiesDo:[:aProp|
-        |modelSelector menuSelector|
+        |modelSelector|
 
         protoSpec := aProp spec.
 
@@ -856,7 +856,7 @@
      - but do not overwrite existing ones.
      Return a string ready to compile into the application class."
 
-    |cls code skip menuSelector protoSpec thisCode|
+    |cls code|
 
     code := ''.
 
@@ -1035,19 +1035,19 @@
      - but do not overwrite existing ones.
      Return a string ready to compile into the application class."
 
-    |cls code skip menuSelector protoSpec thisCode
-     definedMethodSelectors iVars t 
+    |cls code menuSelector thisCode
+     definedMethodSelectors
      specArray fullSpec winSpec menuSpec
      |
 
     className isNil ifTrue:[
-        self warn:'Set first the class!!'.
-        ^ code
+        self warn:'Define the class first !!'.
+        ^ nil
     ].
 
     (cls := self resolveName:className) isNil ifTrue:[
         self warn:'Class ', className asString, ' does not exist!!'.
-        ^ code
+        ^ nil
     ].
 
     specArray := treeView generateFullSpecForComponents:#() named:nil.
@@ -1055,13 +1055,10 @@
     winSpec := fullSpec window.
     menuSelector := winSpec menu.
 
-    menuSelector isNil ifTrue:[
+    (menuSelector notNil 
+    and:[ (cls respondsTo:menuSelector) ]) ifFalse:[
         self warn:'No menu defined (yet)'.
-        ^ code
-    ].
-    (cls respondsTo:menuSelector) ifFalse:[
-        self warn:'No menu defined (yet)'.
-        ^ code.
+        ^ nil.
     ].
     menuSpec := cls perform:menuSelector.
     menuSpec := menuSpec decodeAsLiteralArray.