set window specification after realization of the window
authorca
Wed, 22 Apr 1998 10:04:11 +0200
changeset 798 c1116ba57e66
parent 797 6494228f845a
child 799 22734b99f830
set window specification after realization of the window
UIPainter.st
--- a/UIPainter.st	Tue Apr 21 20:37:36 1998 +0200
+++ b/UIPainter.st	Wed Apr 22 10:04:11 1998 +0200
@@ -2623,39 +2623,32 @@
 !
 
 openOnClass:aClass andSelector:aSelector
-    "opens the GUI Painter on aClass and aSelector"
-
-    |painter window|
-
+    "opens the GUI Painter on aClass and aSelector
+    "
     aClass isNil ifTrue:[
         (self confirm:'No class given to the GUI Painter (class was probably renamed?)\\Open anyway (to create a new window spec) ?' withCRs)
         ifFalse:[^ nil].
     ].
-
     self openInterface.
 
-    window := self window.
-    [window realized] whileFalse:[Delay waitForSeconds:0.01].
-
-    aClass notNil ifTrue:[
-        painter := self painter.
-        self setClass:aClass selector:aSelector.
-
-        (aClass respondsTo:aSelector) ifTrue:[  
-            painter setupFromSpec:(aClass perform:aSelector).
-        ]
-    ].
+    specSelector := aSelector.
+    specClass := aClass.
+
+
 !
 
 postOpenWith: aBuilder
     "sets the root of the tree view as first selection;
      sets the grid parameters, if defined"
 
-    |painter settings gridPara hspace vspace|
-
-    super postOpenWith: aBuilder.
-
-    treeView selection: #(1).
+    |painter settings gridPara hspace vspace cls sel|
+
+    super postOpenWith:aBuilder.
+
+    cls := specClass.
+    sel := specSelector.
+    specSelector := nil.
+    specClass    := nil.
 
     painter  := self painter.
     settings := self class settings.
@@ -2668,6 +2661,15 @@
     painter gridAlign: (settings at: #GridAlign ifAbsent: [false]).
     painter clear.
 
+    cls notNil ifTrue:[
+        self setClass:cls selector:sel.
+
+        (cls respondsTo:sel) ifTrue:[  
+            painter setupFromSpec:(cls perform:sel).
+        ]
+    ].
+    treeView selection: #(1).
+
 ! !
 
 !UIPainter methodsFor:'user actions'!