Popcorn Dave has asked for the wisdom of the Perl Monks concerning the following question:
I am in the process of writing a Perl/Tk program to watch stocks during the day while I'm at work. I used to use a free application to do this, but it's suddenly failed, and the author's web site is unreachable, so I'm trying to recreate his program in Perl.
All is well and good, but I'm stuck on how to do a hyperlink in Tk. I've looked on the web, in Mastering Perl/Tk and in Super Search and come up empty.
The closest I've found is the psuedo code from the Mastering book and it's not helping. I understand the bit
$t->tagBind('goto_stock',"<Button-1>", sub{ ?? });
but I'm stuck on what exactly to call in the subroutine. I know I could just do `iexplorer` or `mozilla` but that doesn't seem right and I don't want to hard code a browser in to the program.
How would Tk know that I want to bind to a hyperlink? Is there a generic way to determine what the default browser on the system is?
Also if there's an example of this somewhere that I've missed, I'd really appreciate it if someone could let me know.
Update: Sorry I didn't make it clear initially, but I want to be able to use the binding to a hyperlink to visit Yahoo Finance to get to the page for the stock in question - e.g. GE, not to watch the quotes in a browser window. The quotes are being updated from a CSV file that I'm grabbing from Yahoo.
There is no emoticon for what I'm feeling now.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Binding hyperlinks to text using Perl/Tk
by kvale (Monsignor) on Mar 11, 2004 at 06:18 UTC | |
by Popcorn Dave (Abbot) on Mar 11, 2004 at 06:31 UTC | |
by BUU (Prior) on Mar 11, 2004 at 08:07 UTC | |
|
Re: Binding hyperlinks to text using Perl/Tk
by saintmike (Vicar) on Mar 11, 2004 at 05:43 UTC | |
by Popcorn Dave (Abbot) on Mar 11, 2004 at 05:54 UTC | |
|
Re: Binding hyperlinks to text using Perl/Tk
by zentara (Cardinal) on Mar 11, 2004 at 15:28 UTC |