From: Thomas, T. B <tim...@lm...> - 2001-01-23 17:42:52
|
Aldo - pretty cool, did you just implement that? I seem to be getting a not-very-descriptive error when I try your code. See below. Tim D:\Archive\scripts\completed\digitaltool>perl aldourl.gpl Wrong number of parameters: expected 0, got 2. BEGIN failed--compilation aborted at aldourl.gpl line 2. D:\Archive\scripts\completed\digitaltool>cat aldourl.gpl use Win32::GUI; use Win32::GUI::HyperLink; my $Window =3D new Win32::GUI::Window( -title =3D> 'Win32::GUI::HyperLink demo', -pos =3D> [ 100, 100 ], -size =3D> [ 150, 100 ], -name =3D> 'Window', ); $Window->AddHyperLink( -text =3D> "dada's perl lab", -name =3D> "test", -pos =3D> [ 25, 25 ], -url =3D> "http://dada.perl.it", # or: -url =3D> "mailto:dada\@perl.it", ); $Window->Show(); my $rc =3D Win32::GUI::Dialog(0); sub Window_Terminate { return -1; } ------------------------------------------------------------------------= ---- --------------------- Tim Thomas Unix Systems Administrator Lockheed Martin EIS =B7 Denver Data Center 303-430-2281 mailto:tim...@lm... ------------------------------------------------------------------------= ---- --------------------- -----Original Message----- From: Aldo Calpini [mailto:da...@pe...] Sent: Tuesday, January 23, 2001 10:13 AM To: Thomas, Timothy B Subject: Re: [perl-win32-gui-users] Final Code: Click on URL in About Wind ow Thomas, Timothy B wrote: > Sean - Thanks! That was my next step, but didn't yet have the time > to research how to go about doing it. Didn't know it was so easy > to implement a custom cursor like that. Your code works perfectly. please find attached HyperLink.pm, which implements a 'regular' Win32::GUI::HyperLink control ;-) warning: the code is full of black (maybe voodoo) magic. using it is this simple: use Win32::GUI; use Win32::GUI::HyperLink; my $Window =3D new Win32::GUI::Window( -title =3D> 'Win32::GUI::HyperLink demo', -pos =3D> [ 100, 100 ], -size =3D> [ 150, 100 ], -name =3D> 'Window', ); $Window->AddHyperLink( -text =3D> "dada's perl lab", -name =3D> "test", -pos =3D> [ 25, 25 ], -url =3D> "http://dada.perl.it", # or: -url =3D> "mailto:dada\@perl.it", ); $Window->Show(); my $rc =3D Win32::GUI::Dialog(0); sub Window_Terminate { return -1; } you don't need to specify a Click event, the HyperLink class already provides a default one that simply activates the link. =20 > Deviating from Win32-GUI somewhat: > Next step is to figure out how to mimik a "mailto:" for > the e-mail link. Should be easy, once we figure out how to > determine what the default e-mail program is. Not sure what > assication is set for that. .html for the browser is easy, but > what about e-mail's? maybe .msg? Here's the ftype info for .msg > on my NT system, using outlook for e-mail. in my code, I've used the ShellExecute API that works like a charm with a standard "mailto:" linkage. cheers, Aldo __END__ $_=3Dq,just perl,,s, , another ,,s,$, hacker,,print; |