Hyperlink in a dialog

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

2 posts / 0 new
Last post
Hyperlink in a dialog

Submitted by Anonymous on Mon, 12/04/2000 - 20:26. Developers
Does anyone know if there is a way to display a hyperlink
in a dialog so a user can click it and it will fire off the
browser?

Thanks.

John

ICS_support

Well, you can roll your own dialog (Template or Prompt dialog) and display, for example, a button with underlined text or just regular text. When you get the callback, you can invoke a browser.

The complications are a few
1) invoking a browser is really more complicated than simply calling system(). Netscape Navigator has an entire properties-based protocol for invoking the browser with a particular URL. Having implemented the application half of the conversation, I can tell you that the protocol was designed for the convenience of the browser folks. Doing an exec() or a system() call is lots easier but doesn`t let you know when, for example, the browser has failed to come up or isn`t installed properly or is already present.

2) I bet that what you really want to do is to display a bunch of text with a particular string underlined, and then display a browser with a URL associated with that string. This is really a more general problem of displaying HTML or text. One solution may be to wrap the XmHTML widget into a dialog. You can also use the simple browser that XmHTML comes with.