#QUALITY by cg
authorClaus Gittinger <cg@exept.de>
Wed, 26 Feb 2020 13:08:44 +0100
changeset 6831 cd449ea016f0
parent 6830 1c99812db765
child 6832 99aedd6d1719
#QUALITY by cg class: YesNoBox changed: #computePreferredExtent
YesNoBox.st
--- a/YesNoBox.st	Wed Feb 26 01:27:39 2020 +0100
+++ b/YesNoBox.st	Wed Feb 26 13:08:44 2020 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
@@ -269,10 +267,15 @@
                         maxSoFar max:button preferredWidth
                     ].
         nButtons := buttonPanel subViews size.           
-    ].                
-    max := max max:(okButton preferredWidth max:abortButton preferredWidth).
-    okButton width:max.
-    abortButton width:max.
+    ].       
+    okButton notNil ifTrue:[
+        max := max max:(okButton preferredWidth).
+    ].       
+    abortButton notNil ifTrue:[
+        max := max max:(abortButton preferredWidth).
+    ].       
+    okButton notNil ifTrue:[okButton width:max].
+    abortButton notNil ifTrue:[abortButton width:max].
     buttonPanel notNil ifTrue:[
         buttonPanel subViews do:[:each | each width:max].
     ].