ViewStyle.st
changeset 3069 0dc010683048
parent 3057 5d7383ca3aef
child 3084 0fa2dc926084
--- a/ViewStyle.st	Thu Dec 02 19:47:31 1999 +0100
+++ b/ViewStyle.st	Thu Dec 02 20:28:04 1999 +0100
@@ -214,8 +214,36 @@
     "Created: 6.9.1997 / 11:40:16 / cg"
 ! !
 
+!ViewStyle methodsFor:'special'!
+
+newDerivedStyle
+    "create and return a new style, which inherits from
+     the receiver, but possibly overrides individual entries.
+     This may be useful to give a single button some different
+     look (in the future - read the comment in SimpleView>>viewStyle:)"
+
+    ^ self class new
+        superPack:self; 
+        at:#is3D put:(self is3D);
+        at:viewGrey put:(self viewGrey);
+        yourself
+
+    "
+     |panel b1 b2 newStyle|
+
+     panel := HorizontalPanelView new.
+     panel add:(b1 := Button label:'oldStyle').
+     panel add:(b2 := Button label:'newStyle').
+     newStyle := b1 styleSheet newDerivedStyle.
+     newStyle at:'button.activeBackgroundColor' put:Color blue.
+     b2 styleSheet:newStyle.        
+
+     panel open
+    "
+! !
+
 !ViewStyle class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/ViewStyle.st,v 1.23 1999-12-01 21:05:41 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/ViewStyle.st,v 1.24 1999-12-02 19:28:04 cg Exp $'
 ! !