[Seaside] Wrapping ProtoTip

John Thornborrow john at pinesoft.co.uk
Wed Mar 5 12:09:43 UTC 2008


See attached file for SUTooltip class.

Don't forget to add #tooltip method to WARenderCanvas:

  ^SUTooltip new

Usage example:

renderContentOn: html
  html div
    onMouseOver: (html tooltip content: [ :ren | ren strong: 'strong
text' ]);
    with: 'other text'

Not tested for things like quotes in the content.



Hwee-Boon Yar wrote:
> I am wrapping around ProtoTip [1] by implementing SUTip as a subclass
> of SUNamed. And need some help.
> One of the parameters is a piece of HTML, e.g.:
>       new Tip('myElementId', '<em>Italics here</em>');
> Following the spirit of the SU* classes, I can do:
>      html script: (html tip id: 'myElementId';
> 			 content: '<em>Italics here</em>')
> How do I use the canvas object, such as:
>      html script: (html tip id: 'myElementId';
> 			 content: [:h | h em: 'Italics here']
> [1] http://www.nickstakenburg.com/projects/prototip/

Pinesoft Computers are registered in England, Registered number: 2914825. Registered office: 266-268 High Street, Waltham Cross, Herts, EN8 7EA

This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com

-------------- next part --------------
SUPrototype subclass: #SUTooltip
	instanceVariableNames: 'content'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Tooltip'!

!SUTooltip methodsFor: 'private' stamp: 'jmt 3/5/2008 11:59'!
	^'new Tip'! !

!SUTooltip methodsFor: 'private' stamp: 'jmt 3/5/2008 11:57'!
printArgumentsOn: aStream
		nextPutAll: '(this,''';
		nextPutAll: (WARenderCanvas builder render: content);
		nextPutAll: ''')'.! !

!SUTooltip methodsFor: 'accessing' stamp: 'jmt 3/5/2008 11:58'!
	"Answer the value of content"

	^ content! !

!SUTooltip methodsFor: 'accessing' stamp: 'jmt 3/5/2008 11:58'!
content: anObject
	"Set the value of content"

	content := anObject! !

More information about the seaside mailing list