Cursor.st
changeset 144 cf645a1ebbb3
parent 133 ca8ce3916382
child 145 ac7088b0aee5
--- a/Cursor.st	Fri May 12 20:10:19 1995 +0200
+++ b/Cursor.st	Tue May 16 19:17:11 1995 +0200
@@ -28,7 +28,7 @@
 COPYRIGHT (c) 1992 by Claus Gittinger
 	     All Rights Reserved
 
-$Header: /cvs/stx/stx/libview/Cursor.st,v 1.16 1995-04-11 15:54:27 claus Exp $
+$Header: /cvs/stx/stx/libview/Cursor.st,v 1.17 1995-05-16 17:12:35 claus Exp $
 '!
 
 !Cursor class methodsFor:'documentation'!
@@ -49,13 +49,15 @@
 
 version
 "
-$Header: /cvs/stx/stx/libview/Cursor.st,v 1.16 1995-04-11 15:54:27 claus Exp $
+$Header: /cvs/stx/stx/libview/Cursor.st,v 1.17 1995-05-16 17:12:35 claus Exp $
 "
 !
 
 documentation
 "
     I represents cursors in a device independent manner.
+    Normally, cursors are defined at view creation time,
+    via 'aView cursor:aCursor'.
 
     Instance variables:
 
@@ -78,6 +80,132 @@
 	 ...
 
 "
+!
+
+examples
+"
+    get a standard cursor:
+
+	Cursor wait
+	Cursor stop
+	Cursor normal
+
+    create a custom cursor:
+
+	Cursor extent:16@16 
+	       fromArray:#[ 2r00000000 2r00000000
+			    2r00000000 2r00000000
+			    2r00000000 2r00000000
+			    2r11111111 2r11111111
+			    2r11111111 2r11111111
+			    2r00000000 2r00000000
+			    2r00000000 2r00000000
+			    2r11111111 2r11111111
+			    2r11111111 2r11111111
+			    2r00000000 2r00000000
+			    2r00000000 2r00000000
+			    2r11111111 2r11111111
+			    2r11111111 2r11111111
+			    2r00000000 2r00000000
+			    2r00000000 2r00000000
+			    2r00000000 2r00000000]
+		offset:-8@-8   
+
+    define a cursor for a view:
+
+	|v|
+
+	v := View new.
+	v cursor:Cursor stop.
+	v open.
+
+      with above custom cursor:
+
+	|v|
+
+	v := View new.
+	v cursor:(
+	    Cursor extent:16@16 
+	       fromArray:#[ 2r00000000 2r00000000
+			    2r00000000 2r00000000
+			    2r00000000 2r00000000
+			    2r11111111 2r11111111
+			    2r11111111 2r11111111
+			    2r00000000 2r00000000
+			    2r00000000 2r00000000
+			    2r11111111 2r11111111
+			    2r11111111 2r11111111
+			    2r00000000 2r00000000
+			    2r00000000 2r00000000
+			    2r11111111 2r11111111
+			    2r11111111 2r11111111
+			    2r00000000 2r00000000
+			    2r00000000 2r00000000
+			    2r00000000 2r00000000]
+		offset:-8@-8).   
+	v open.
+
+      with multiple views:
+
+	|v1 v2 top|
+
+	top := StandardSystemView new.
+	top extent:300@300.
+	v1 := View origin:0.0@0.0 corner:1.0@0.5 in:top.
+	v1 viewBackground:(Color grey:75).
+	v1 cursor:Cursor thumbsUp.
+	v2 := View origin:0.0@0.5 corner:1.0@1.0 in:top.
+	v2 viewBackground:(Color white).
+	v2 cursor:Cursor wait.
+	top open.
+
+
+    show a cursor in ALL ST/X views for a while:
+        
+	Cursor wait 
+	    showWhile:[
+		(Delay forSeconds:5) wait
+	    ]
+
+
+    show a cursor in a single view for a while:
+
+	|v1 v2 top|
+
+	top := StandardSystemView new.
+	top extent:300@300.
+	v1 := View origin:0.0@0.0 corner:1.0@0.5 in:top.
+	v1 viewBackground:(Color grey:75).
+	v2 := View origin:0.0@0.5 corner:1.0@1.0 in:top.
+	v2 viewBackground:(Color white).
+	top open.
+
+	v1 withCursor:Cursor wait 
+	   do:[
+		  (Delay forSeconds:10) wait
+	      ]
+
+
+    show a cursor in all views belonging to a windowGroup:
+    (have to wait until top is visible to access windowGroup)
+
+	|v1 v2 top|
+
+	top := StandardSystemView new.
+	top extent:300@300.
+	v1 := View origin:0.0@0.0 corner:1.0@0.5 in:top.
+	v1 viewBackground:(Color grey:75).
+	v2 := View origin:0.0@0.5 corner:1.0@1.0 in:top.
+	v2 viewBackground:(Color white).
+	top open.
+
+	[top shown] whileFalse:[Processor yield].
+	top windowGroup
+	    withCursor:Cursor wait 
+	    do:[
+		  (Delay forSeconds:10) wait
+	       ]
+"
 ! !
 
 !Cursor class methodsFor:'initialization'!