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 = new Win32::GUI::Window(
        -title   => 'Win32::GUI::HyperLink demo',
        -pos     => [ 100, 100 ],
        -size    => [ 150, 100 ],
        -name    => 'Window',
    );
    $Window->AddHyperLink(
        -text    => "dada's perl lab",
        -name    => "test",
        -pos     => [ 25, 25 ],
        -url     => "http://dada.perl.it";,
        # or: -url => "mailto:[EMAIL PROTECTED]",
    );
    $Window->Show();
    my $rc = Win32::GUI::Dialog(0);

    sub Window_Terminate {
        return -1;
    }

----------------------------------------------------------------------------
---------------------
Tim Thomas
Unix Systems Administrator
Lockheed Martin EIS ยท Denver Data Center
303-430-2281
mailto:[EMAIL PROTECTED]
----------------------------------------------------------------------------
---------------------


-----Original Message-----
From: Aldo Calpini [mailto:[EMAIL PROTECTED]
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 = new Win32::GUI::Window(
        -title   => 'Win32::GUI::HyperLink demo',
        -pos     => [ 100, 100 ],
        -size    => [ 150, 100 ],
        -name    => 'Window',
    );
    $Window->AddHyperLink(
        -text    => "dada's perl lab",
        -name    => "test",
        -pos     => [ 25, 25 ],
        -url     => "http://dada.perl.it";,
        # or: -url => "mailto:[EMAIL PROTECTED]",
    );
    $Window->Show();
    my $rc = 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.
    
> 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__
$_=q,just perl,,s, , another ,,s,$, hacker,,print;

Reply via email to