Hello all,
I have a Tk program on ActiveState Perl for Win32 which can display its own manual in MSIE fine. I'd like to show it in Firefox instead if they have that browser.
Someone sent me this snippit. And it works fine for MSIE but makes Tk to hang while Firefox stays up after being called to show the doc.
Someone please tell me how to make it work as well for Firefox as it does for MSIE.
Thanks bunches,
# Launch new process the Win32 way. # Use alternate browser if installed. sub show_in_browser { no strict; if ( $browser =~ m/mozilla|firefox/ ) { # Display in Mozilla or its derivatives... $_ = shift || ''; my $command = m!^(?:ftp|http|file)://! ? sprintf URL, $_ : -r ($_) ? sprintf URL, 'file://' . abs_path($_) : s!^(www\..+)!http://$1! ? sprintf URL, $_ : s!^(ftp\..+)!ftp://$1! ? sprintf URL, $_ : s/^mailto:// ? sprintf MAIL, $_ : warn "usage: $0 (filename|URL|mailto:foo\@bar.com)\n" ; # Could add a LOG file output here. system "$browser", -remote => sprintf( $command, $_ ); } else { system( qq|start "$browser" "$browser"|, qq|"$_[0]"| ) && log_write( "Oops! Trouble opening $browser"); } }
In reply to Open doc in Firefox from Tk with no Tk hanging by Frandajo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |