Displaying HTML links in a dialog

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

Displaying HTML links in a dialog

Kevin Powe
Hi all. My apologies if this message comes through twice, but I made an
abortive attempt to post this question from DejaNews.

First of all, a big thankyou to Object Arts for putting together Dolphin
Smalltalk - I've been using it for personal projects for the last two years,
and could never have done that (especially while I was at Uni) without their
generous licensing scheme.

And now, the question:

I'm trying to display a mailto: link in a dialog box for an application, and
after a look through the Wiki web and some fiddling with widgets, I'm
stumped as to how I might do this.

How would I go about doing this?

Kind regards,
Kevin Powe.


Reply | Threaded
Open this post in threaded view
|

Re: Displaying HTML links in a dialog

Ian Bartholomew-3
Kevin,

"Kevin Powe" <[hidden email]> wrote in message
news:8v9nss$a6g$[hidden email]...

> I'm trying to display a mailto: link in a dialog box for an application,
and
> after a look through the Wiki web and some fiddling with widgets, I'm
> stumped as to how I might do this.
>
> How would I go about doing this?

I'm not 100% sure what you mean but if you want a button to open the users
default mail client in "compose" mode then evaluating the following should
work. It does on my system using OutlookExpress anyway!!!

ShellLibrary default shellOpen: 'mailto:[hidden email]'

If you actually want some text which looks and acts like a link in an HTML
document then that is a bit more difficult and will need some further
thought.

Ian


Reply | Threaded
Open this post in threaded view
|

Re: Displaying HTML links in a dialog

Andy Bower
Kevin,

> > I'm trying to display a mailto: link in a dialog box for an application,
> and
> > after a look through the Wiki web and some fiddling with widgets, I'm
> > stumped as to how I might do this.
> >
> > How would I go about doing this?
>
> I'm not 100% sure what you mean but if you want a button to open the users
> default mail client in "compose" mode then evaluating the following should
> work. It does on my system using OutlookExpress anyway!!!
>
> ShellLibrary default shellOpen: 'mailto:[hidden email]'
>
> If you actually want some text which looks and acts like a link in an HTML
> document then that is a bit more difficult and will need some further
> thought.

If Ian's solution isn't good enough then what I assume you want to do is
have an underlined link within some text in the dialog. The first idea that
comes to mind would be to use the "link" facilities in RTF. I'm not exactly
sure how you'd go about it but theoretically you should be able to display
links in the RichTextEdit and with a bit of work get hold of events when
these things are clicked. A peruse of MSDN might help.

http://www.msdn.microsoft.com/library/default.asp

An alternative for Dolphin 4 (how can I tempt you like this) would be to
embed a web browser control inside your dialog. You can do this using a
URLPresenter. Using this you can make the browser control display either a
URL or a piece of HTML text by setting the #value: of the presenter. In the
case of the latter you have to prefix the text (for some reason) with
"about:".  Hence you might write:

urlPresenter value: 'about:<a
href="mailto:[hidden email]">[hidden email]</a>'

When clicked in your dialog this will launch the default mail client on the
given address.

Best regards,

Andy Bower
Object Arts Ltd.
http://www.object-arts.com

"Not all addictions are bad for you"
http://www.object-arts.com/Addiction.htm