[Q] HyperText fileOut and tutorial

David Faught dave_faught at yahoo.com
Fri Sep 24 18:14:50 UTC 2004


Sorry to hear about Mr. Smith's passing.  My condolences for your loss,
and the loss to this community.

Here are some files that I could find.  These are NOT the most up to
date ones.  I included Bert's comments about these files, but I'm not
sure that I understand exactly what he means well enough to make a
change set out of the fileOut method.

If I "attach" these, or newer, files on a Swiki page, can these files
still be referenced from SqueakMap?




	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 
-------------- next part --------------
Hypertext tutorial
Bert Freudenberg bert at isg.cs.uni-magdeburg.de 
Tue Jul 22 21:37:27 CEST 2003 

Previous message: Hypertext tutorial 

--------------------------------------------------------------------------------

Terseman sez:

	(StandardFileStream newFileNamed: aFileName)
		nextPutAll: 'StringHolder new contents: ';
		store: aText;
		nextPutAll: '; openLabel: ';
		store: aTitleString;
		close

And the right place IMHO would be on the instance side of Text, 
category printing, with a method selector of 
#storeAsStringHolderTitled:onFile:.

And of course this would be a useful addition to ParagraphEditor 
class>>shiftedYellowButtonMenu. If you do this, you could also make the 
above method store on a stream and create the stream from a file in the 
menu code. That would actually make a nice ENH :-)

Yet another way would be to store this as text only, and create a new 
file extension (like .sqt) that is recognized by the file list and 
creates the StringHolder at load time.

-- Bert

Am Dienstag, 22.07.03 um 19:33 Uhr schrieb David N Smith:

>
> Bert:
>
> Good idea. Attached is an equivalent file, and a new method for 
> Smalltalk (where should it go?) which will create such files.
>
> Dave

-------------- next part --------------
'From Squeak3.5 of ''11 April 2003'' [latest update: #5180] on 22 July 2003 at 1:26 pm'!

!SystemDictionary methodsFor: 'dave''s stuff' stamp: 'dns 7/22/2003 13:25'!
writeTextAsStringHolder: aText title: aTitleString on: fileName
	" Given a Text object, write it to disk (as fileName) so it can be filed in and a window (titled as aTitleString) opened with it. "
	| ws fs |

	ws := WriteStream on: (String new: 1000).
	ws nextPutAll: 'StringHolder new contents: (Text string: ';
		cr; nextPutAll: aText string printString;
		cr; nextPutAll: 'runs:  ';
		cr; nextPutAll: aText runs storeString;
		cr; nextPutAll: ');
		openLabel:';
		cr; nextPutAll: aTitleString printString.
	fs := StandardFileStream newFileNamed: fileName.
	fs nextPutAll: ws contents.
	fs close.
-------------- next part --------------
StringHolder new contents: (Text string: '                                               Hypertext in Squeak

Note: This is a rough draft and may contain errors or have omissions. Please let me know if you find problems.


Squeak allows text to be marked up in a variety of ways in addition to colors. Press Alt-6 (Cmd-6 on a Mac) to get a menu.

	Doit		Mark the text so that it is executed when used as a button.
				Select the text, then Alt-6, then choose Doit.
				Example: Transcript cr; show: ''Example''

				The expression can be hidden. First type:
				Example: Text<Transcript cr; show: ''Example2''> on the Transcript

				Then select "Text<Transcript cr; show: ''Example2''>" and select Doit:
				Example: Text on the Transcript

				Note that the syntax:
					text<expression>
				is special and will occur in other menu items.

	Print it		This is identical to Doit except that the result of the expression is printed.

				Example: Then (2+2) is<(2+2)>

				Highlight ''(2+2) is<(2+2)>'' then select Print it from the menu
				Example: Then (2+2) is

	Link to comment of class
	Link to definition of class
	Link to hierarchy of class
				Select a class name, then Alt-6 and select ''Link to --- of class''

				Example:  View the class comment of Object
				Example:  View the definition of Object
				Example:  View the hierarchy of Integer

	Link to method
				Link to method uses the special syntax described under Doit above.

				Example:	View the method definition of a method<Array size>
				Final text:	View the method definition of a method

				Example:	View the method definition of a method<Interval at:put:>
				Final text:	View the method definition of a method
				
	Be a web URL link
				Link to a web site. The URL can be in open text; simply select it
				then Alt-6, then select ''be a web URL link''. Alternatively, the
				special syntax described above may be used.

				Example:	Link to http://dnsmith.com 
				Final text:	Link to http://dnsmith.com 

				Example:	Link to my site<http://dnsmith.com>  
				Final text:	Link to my site

	Edit hidden info
				Converts text to its original form so that the hidden text is visible.

	Copy hidden info
				Copies the hidden info to the cut/paste buffer.


For Squeak 3.4, 3.5, 3.6
David N Smith
dnsmith at watson.ibm.com
24 July 2003'
runs:  (RunArray runs: #(436 30 204 4 331 8 196 6 38 6 37 7 202 6 120 6 277 18 81 4 242 ) values: ((Array new: 21) at: 1 put: ((Array new: 1) at: 1 put: (TextFontChange basicNew instVarAt: 1 put: 1; yourself); yourself); at: 2 put: ((Array new: 2) at: 1 put: (TextFontChange basicNew instVarAt: 1 put: 1; yourself); at: 2 put: (TextDoIt basicNew instVarAt: 1 put: 'Transcript cr; show: ''Example'''; yourself); yourself); at: 3 put: ((Array new: 1) at: 1 put: (TextFontChange basicNew instVarAt: 1 put: 1; yourself); yourself); at: 4 put: ((Array new: 2) at: 1 put: (TextFontChange basicNew instVarAt: 1 put: 1; yourself); at: 2 put: (TextDoIt basicNew instVarAt: 1 put: 'Transcript cr; show: ''Example2'''; yourself); yourself); at: 5 put: ((Array new: 1) at: 1 put: (TextFontChange basicNew instVarAt: 1 put: 1; yourself); yourself); at: 6 put: ((Array new: 2) at: 1 put: (TextFontChange basicNew instVarAt: 1 put: 1; yourself); at: 2 put: (TextPrintIt basicNew instVarAt: 1 put: '(2+2)'; yourself); yourself); at: 7 put: ((Array new: 1) at: 1 put: (TextFontChange basicNew instVarAt: 1 put: 1; yourself); yourself); at: 8 put: ((Array new: 2) at: 1 put: (TextFontChange basicNew instVarAt: 1 put: 1; yourself); at: 2 put: (TextLink basicNew instVarAt: 1 put: 'Object Comment'; yourself); yourself); at: 9 put: ((Array new: 1) at: 1 put: (TextFontChange basicNew instVarAt: 1 put: 1; yourself); yourself); at: 10 put: ((Array new: 2) at: 1 put: (TextFontChange basicNew instVarAt: 1 put: 1; yourself); at: 2 put: (TextLink basicNew instVarAt: 1 put: 'Object Definition'; yourself); yourself); at: 11 put: ((Array new: 1) at: 1 put: (TextFontChange basicNew instVarAt: 1 put: 1; yourself); yourself); at: 12 put: ((Array new: 2) at: 1 put: (TextFontChange basicNew instVarAt: 1 put: 1; yourself); at: 2 put: (TextLink basicNew instVarAt: 1 put: 'Integer Hierarchy'; yourself); yourself); at: 13 put: ((Array new: 1) at: 1 put: (TextFontChange basicNew instVarAt: 1 put: 1; yourself); yourself); at: 14 put: ((Array new: 2) at: 1 put: (TextFontChange basicNew instVarAt: 1 put: 1; yourself); at: 2 put: (TextLink basicNew instVarAt: 1 put: 'Array size'; yourself); yourself); at: 15 put: ((Array new: 1) at: 1 put: (TextFontChange basicNew instVarAt: 1 put: 1; yourself); yourself); at: 16 put: ((Array new: 2) at: 1 put: (TextFontChange basicNew instVarAt: 1 put: 1; yourself); at: 2 put: (TextLink basicNew instVarAt: 1 put: 'Interval at:put:'; yourself); yourself); at: 17 put: ((Array new: 1) at: 1 put: (TextFontChange basicNew instVarAt: 1 put: 1; yourself); yourself); at: 18 put: ((Array new: 2) at: 1 put: (TextFontChange basicNew instVarAt: 1 put: 1; yourself); at: 2 put: (TextURL basicNew instVarAt: 1 put: 'http://dnsmith.com'; yourself); yourself); at: 19 put: ((Array new: 1) at: 1 put: (TextFontChange basicNew instVarAt: 1 put: 1; yourself); yourself); at: 20 put: ((Array new: 2) at: 1 put: (TextFontChange basicNew instVarAt: 1 put: 1; yourself); at: 2 put: (TextURL basicNew instVarAt: 1 put: 'http://dnsmith.com'; yourself); yourself); at: 21 put: ((Array new: 1) at: 1 put: (TextFontChange basicNew instVarAt: 1 put: 1; yourself); yourself); yourself))
);
		openLabel:'Text'


More information about the Squeak-dev mailing list