HTML simple question ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

HTML simple question ?

Bruno Brasesco
Hi all,

Is there any way in Dolphin to display aString (in HTML format) in
aURLPresenter without creating a File on hard drive ?

Regards
Bruno


Reply | Threaded
Open this post in threaded view
|

Re: HTML simple question ?

Louis Sumberg-2
Bruno,

> Is there any way in Dolphin to display aString (in HTML format) in
> aURLPresenter without creating a File on hard drive ?

Dolphin's TipOfTheDay class uses the following type of approach, though I
believe the string's size should be no greater than 1,000 or so.

URLPresenter showOn: 'about: <h2>Hello</h2><h1>there</h1>'.

-- Louis


Reply | Threaded
Open this post in threaded view
|

Re: HTML simple question ?

Steve Alan Waring
Louis Sumberg wrote:

> Bruno,
>
>> Is there any way in Dolphin to display aString (in HTML format) in
>> aURLPresenter without creating a File on hard drive ?
>
> Dolphin's TipOfTheDay class uses the following type of approach,
> though I believe the string's size should be no greater than 1,000 or
> so.
>
> URLPresenter showOn: 'about: <h2>Hello</h2><h1>there</h1>'.
>
> -- Louis

If this is a limitation, you can use the document's IPersistStreamInit
interface. An example would be;

   pPersistStream := self document queryInterface: IPersistStreamInit.
   pStream := (IStream onHGLOBAL) nextPutAll: aString asByteArray;
reset;yourself.
   pPersistStream initNew.
   pPersistStream Load: pStream

Where document is accessed via;
    self view controlDispatch document

One limitation of this method is that no host is set into the document and
therefore relative hrefs can not be resolved. As I understand it, if you
need to load a string as if it was obtained from a certain url, you need to
implement a URLMoniker.

Steve

--
Steve Waring
Email: [hidden email]
About: http://www.dolphinharbor.org/dh/harbor/steve.html
Journal: http://www.stevewaring.net/blog/home/index.html