Set windowClasses based on application class name.
authorStefan Vogel <sv@exept.de>
Thu, 07 Aug 2003 21:34:55 +0200
changeset 3918 f708df11e804
parent 3917 806839e6531e
child 3919 6b390fe57e96
Set windowClasses based on application class name.
SimpleView.st
--- a/SimpleView.st	Thu Aug 07 21:25:54 2003 +0200
+++ b/SimpleView.st	Thu Aug 07 21:34:55 2003 +0200
@@ -2960,6 +2960,16 @@
     ^ width + (2*borderWidth)
 ! !
 
+!SimpleView methodsFor:'accessing-display attributes'!
+
+setWindowClass:windowClassNameString name:nameString
+    "define class and name of a window.
+     This may be used by the window manager to
+     select client specific resources."
+
+    device setWindowClass:windowClassNameString name:nameString in:drawableId.
+! !
+
 !SimpleView methodsFor:'accessing-hierarchy'!
 
 components
@@ -3086,10 +3096,10 @@
     n := 1.
     v := self.
     [v notNil] whileTrue:[
-	(next := v container) isNil ifTrue:[^ v].
-	v := next.
-	n := n + 1.
-	n > 1000 ifTrue:[self halt:'oops - circular superView chain'].
+        (next := v container) isNil ifTrue:[^ v].
+        v := next.
+        n := n + 1.
+        n > 1000 ifTrue:[self error:'circular superView chain'].
     ].
 
     ^ nil
@@ -3371,21 +3381,21 @@
      TODO: this code is so ugly and badly designed - it must be redesigned
      or at least well documented."
 
-    |builder subSpec notAnAppModel savedApp savedView masterApp|
+    |builder subSpec isApplicationModel thisApp savedView masterApp|
 
     aWindowSpecOrSpecSymbol isNil ifTrue:[^ self].
 
     (builder := aBuilder) isNil ifTrue:[
         "/ problem: anApplication could have no builder
         "/          or anApplication could be a non-appModel (theoretically - only providing a spec)
-        notAnAppModel := false.
-        builder := anApplication perform:#builder ifNotUnderstood:[notAnAppModel := true. nil].
+        isApplicationModel := true.
+        builder := anApplication perform:#builder ifNotUnderstood:[isApplicationModel := false. nil].
         builder isNil ifTrue:[
-            notAnAppModel ifTrue:[
-                 builder := UIBuilder new.    
-            ] ifFalse:[
+            isApplicationModel ifTrue:[
                  anApplication createBuilder.
                  builder := anApplication builder
+            ] ifFalse:[
+                 builder := UIBuilder new.    
             ]
         ]
     ].
@@ -3401,20 +3411,19 @@
     "/ if the appl is not the master, but the masters builder is used,
     "/ we have to temporarily change the builders window
 
-    masterApp := anApplication perform:#masterApplication ifNotUnderstood:[notAnAppModel := true. nil].
-    (notAnAppModel not and:[anApplication ~~ builder application]) ifTrue:[
-        masterApp ~~ builder application ifTrue:[self halt:'should not happen'].
-
-        savedApp := builder application.
+    masterApp := anApplication perform:#masterApplication ifNotUnderstood:[isApplicationModel := false. nil].
+    thisApp := builder application.
+    (isApplicationModel and:[anApplication ~~ thisApp]) ifTrue:[
+        masterApp ~~ thisApp ifTrue:[self error:'should not happen'].
+
         builder application:anApplication.
-
         savedView := builder window.
         builder window:self.
         [
             anApplication buildSubCanvas:subSpec withBuilder:builder.
         ] ensure:[
             builder window:savedView.
-            builder application:savedApp.
+            builder application:thisApp.
         ].
 
     ] ifFalse:[
@@ -9389,7 +9398,7 @@
 !SimpleView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.476 2003-07-04 17:04:51 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.477 2003-08-07 19:34:55 stefan Exp $'
 ! !
 
 SimpleView initialize!