"Pop" an alert of some sort in Windows

Discussion in 'Perl Misc' started by still me, Jul 8, 2007.

  1. still me

    still me Guest

    I have a program that I need to run at Windows startup (I can handle
    that part, at least as a command line startup->run). But, in some
    cases I'd like to pop a window/warning in MS-windows at completion.
    I'm really only acquainted with Perl as a command line or cgi
    interface.

    How can I pop something up in Windows? Do I need a completely
    different strategy? I'd prefer not to end up in an MS language... I
    just need some sort of alert for certain error conditions at
    completion.

    Thanks,
     
    still me, Jul 8, 2007
    #1
    1. Advertising

  2. still me

    Lambik Guest

    "still me" <> wrote in message
    news:...
    > I have a program that I need to run at Windows startup (I can handle
    > that part, at least as a command line startup->run). But, in some
    > cases I'd like to pop a window/warning in MS-windows at completion.
    > I'm really only acquainted with Perl as a command line or cgi
    > interface.
    >
    > How can I pop something up in Windows? Do I need a completely
    > different strategy? I'd prefer not to end up in an MS language... I
    > just need some sort of alert for certain error conditions at
    > completion.


    #!/usr/bin/perl
    use warnings;
    use strict;
    use Win32::GUI ();

    my $main = Win32::GUI::Window->new(-name => 'Main',
    -caption => "I have something to say",
    -pos => [100,100],
    -size => [300,100],

    );
    my $label = $main->AddLabel(-text => "We are done running",
    -pos => [10,10],
    -size => [$main->ScaleWidth() - 100,
    $main->ScaleHeight()-50]

    );
    my $button= $main->AddButton(
    -text => 'Ok',
    -ok => 1,
    -default => 1,
    -tabstop => 1,
    -pos => [$main->ScaleWidth()-175, $main->ScaleHeight()-25],
    -size => [70,20],
    -onClick => sub { return -1; },
    );

    $main->Center();
    $main->Show();
    Win32::GUI::Dialog();
     
    Lambik, Jul 8, 2007
    #2
    1. Advertising

  3. On Sun, 08 Jul 2007 16:06:09 GMT, still me <>
    wrote:

    >How can I pop something up in Windows? Do I need a completely
    >different strategy? I'd prefer not to end up in an MS language... I
    >just need some sort of alert for certain error conditions at
    >completion.


    Well, just use some toolkit. The most popular one for Perl is Tk, but
    there are alternatives.


    Michele
    --
    {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
    (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
    ..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
    256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
     
    Michele Dondi, Jul 8, 2007
    #3
  4. still me

    still me Guest

    On Sun, 8 Jul 2007 18:42:07 +0200, "Lambik" <> wrote:


    >use Win32::GUI ();


    Thanks... got me going where I need to be.
     
    still me, Jul 8, 2007
    #4
  5. On Sun, 8 Jul 2007 18:42:07 +0200, "Lambik" <> wrote:

    >use Win32::GUI ();


    Why an explicitly empty import list?

    >my $main = Win32::GUI::Window->new(-name => 'Main',
    > -caption => "I have something to say",


    Remember the Misfits? ("Well I got something to saaaay!")

    I installed Win32::GUI but the documentation seems to be lacking both
    from command line perldoc (which I generally use) and from the HTML
    version: in fact it doesn't seem to follow the standard POD structure,
    but the latter has a table of contents with links... which are...
    ehm... broken!


    Michele
    --
    {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
    (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
    ..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
    256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
     
    Michele Dondi, Jul 8, 2007
    #5
  6. still me

    Lambik Guest

    "Michele Dondi" <> wrote in message
    news:...
    > On Sun, 8 Jul 2007 18:42:07 +0200, "Lambik" <> wrote:
    >
    > >use Win32::GUI ();

    >
    > Why an explicitly empty import list?
    >
    > >my $main = Win32::GUI::Window->new(-name => 'Main',
    > > -caption => "I have something to say",

    >
    > Remember the Misfits? ("Well I got something to saaaay!")
    >
    > I installed Win32::GUI but the documentation seems to be lacking both
    > from command line perldoc (which I generally use) and from the HTML
    > version: in fact it doesn't seem to follow the standard POD structure,
    > but the latter has a table of contents with links... which are...
    > ehm... broken!


    Yes, the docs are not great. The HTML version has 'some' docs and there is a
    lot "to be done" among it, so you have to get the fast majority of the info
    from the net (http://perl-win32-gui.sourceforge.net/). There is a great
    support from the authors though. And the mailing list is active and useful.
    I love it. It is very versatile. There are windows stuff you can do which
    you can't do with TK and as far as I know not even with wxPerl. Like those
    windows you have in MSN Messenger. You know those "someone has signed in"
    garbage.
     
    Lambik, Jul 8, 2007
    #6
  7. On Sun, 8 Jul 2007 23:24:23 +0200, "Lambik" <> wrote:

    >I love it. It is very versatile. There are windows stuff you can do which
    >you can't do with TK and as far as I know not even with wxPerl. Like those
    >windows you have in MSN Messenger. You know those "someone has signed in"
    >garbage.


    Well, I wouldn't call it "garbage". I can imagine useful uses for
    those. Actually the behaviour with IMs is good. Pidgin, for example,
    doesn't at least under Windows, and it only gives an acoustic signal:
    so sometimes I maximize it to check who logged in, and of course I
    would prefer the notification instead. Said this, the thingie is
    *probably* doable in Tk and in other toolkits: it's enough to fork
    another process which will consist of a single window, emulating all
    the motion by itself, and with special decoration... it is not true
    that all Tk apps are forced to have the classical Tk look & feel:
    indeed they can be quite different. Of course I've seen *gurus* do
    this kinda things, and I'm not, let alone a beginner, so I wouldn't
    know where to start, but yes: I think it's *doable*, just not easily.


    Michele
    --
    {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
    (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
    ..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
    256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
     
    Michele Dondi, Jul 12, 2007
    #7
  8. still me

    RobMay Guest

    On 8 Jul, 21:17, Michele Dondi <> wrote:
    > On Sun, 8 Jul 2007 18:42:07 +0200, "Lambik" <> wrote:
    > >use Win32::GUI ();

    >
    > Why an explicitly empty import list?


    History, and backwards compatibility. Win32::GUI up to V1.04 exports
    lots of constants by default (300+ of them), and if you don't want
    them you need to apply an empty import list. V1.05 still exports
    these constants by default, for backwards compatibility, but warns
    with an empty export list - so right now now you need an empty export
    list if you don't want the constants, and you don't want the warning.
    A future version (probably 1.06, but not decided yet) will stop
    exporting the default constants (and will issue a warning without an
    empty import list); A further release will remove the warning,
    allowing a simple
    use Win32::GUI;
    to not pollute the caller's namespace. It takes time to change the
    past.

    Regards,
    Rob.
     
    RobMay, Jul 13, 2007
    #8
  9. still me

    RobMay Guest

    On 8 Jul, 21:17, Michele Dondi <> wrote:
    > On Sun, 8 Jul 2007 18:42:07 +0200, "Lambik" <> wrote:
    > >use Win32::GUI ();


    > I installed Win32::GUI but the documentation seems to be lacking both
    > from command line perldoc (which I generally use) and from the HTML
    > version: in fact it doesn't seem to follow the standard POD structure,
    > but the latter has a table of contents with links... which are...
    > ehm... broken!


    What version of Win32::GUI, and what version of perl? I fixed the
    missing POD documents (I think) with Win32::GUI 1.05. Sadly with
    ActivePerl 5.8.8, the way PPM deals with generating HTML from the POD
    changed, and despite great efforts to distribute correctly formatted
    and linked HTML pages, PPM insists on re-building them , and does so
    wrong (if you look at the HTML docs, you'll find all the links are
    absolute, and o the directory where the PPM got unpacked. It's on my
    list of things to look into for the ext release. In the meantime all
    the docs are available on line at http://perl-win32-gui.sourceforge.net/docs/
    (although I won't pretend that they are complete or 100% accurate)

    Regards,
    Rob.
     
    RobMay, Jul 13, 2007
    #9
  10. On Thu, 12 Jul 2007 17:28:05 -0700, RobMay <>
    wrote:

    >What version of Win32::GUI, and what version of perl? I fixed the


    C:\temp>perl -v

    This is perl, v5.8.8 built for MSWin32-x86-multi-thread
    (with 50 registered patches, see perl -V for more detail)

    Copyright 1987-2006, Larry Wall

    Binary build 820 [274739] provided by ActiveState
    http://www.ActiveState.com
    Built Jan 23 2007 15:57:46

    C:\temp>perl -MWin32::GUI=99 -e1
    Win32::GUI version 99 required--this is only version 1.03 at
    C:/Programmi/Perl/l
    ib/Exporter/Heavy.pm line 121.
    BEGIN failed--compilation aborted.


    Michele
    --
    {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
    (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
    ..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
    256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
     
    Michele Dondi, Jul 13, 2007
    #10
  11. still me

    Lambik Guest

    "Michele Dondi" <> wrote in message
    news:...
    > C:\temp>perl -MWin32::GUI=99 -e1
    > Win32::GUI version 99 required--this is only version 1.03 at


    As Rob has mentioned, the most recent version is 1.05 which you can also get
    at Bribes (add http://www.bribes.org/perl/ppm/package.lst to the ppm
    repository).
     
    Lambik, Jul 13, 2007
    #11
  12. On Fri, 13 Jul 2007 11:38:21 +0200, "Lambik" <>
    wrote:

    >> Win32::GUI version 99 required--this is only version 1.03 at

    >
    >As Rob has mentioned, the most recent version is 1.05 which you can also get
    >at Bribes (add http://www.bribes.org/perl/ppm/package.lst to the ppm
    >repository).


    Strange: it is *already* amongst the repositories I set up in ppm...


    Michele
    --
    {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
    (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
    ..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
    256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
     
    Michele Dondi, Jul 13, 2007
    #12
  13. still me

    Lambik Guest

    "Michele Dondi" <> wrote in message
    news:...
    > On Fri, 13 Jul 2007 11:38:21 +0200, "Lambik" <>
    > wrote:
    >
    > >> Win32::GUI version 99 required--this is only version 1.03 at

    > >
    > >As Rob has mentioned, the most recent version is 1.05 which you can also

    get
    > >at Bribes (add http://www.bribes.org/perl/ppm/package.lst to the ppm
    > >repository).

    >
    > Strange: it is *already* amongst the repositories I set up in ppm...
    >
    >
    > Michele

    Then I would say: Either you've installed the wrong one (when two are
    listed) or you have made a typo in the repository. Because it is really
    there.
     
    Lambik, Jul 13, 2007
    #13
  14. On Fri, 13 Jul 2007 13:29:50 +0200, "Lambik" <>
    wrote:

    >Then I would say: Either you've installed the wrong one (when two are
    >listed) or you have made a typo in the repository. Because it is really
    >there.


    Well, I just did

    ppm install Win32::GUI

    perhaps the order of the repositories does matter? I assumed the most
    up to date available version would have been chosen...


    Michele
    --
    {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
    (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
    ..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
    256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
     
    Michele Dondi, Jul 13, 2007
    #14
  15. On Fri, 13 Jul 2007 14:21:05 +0200, "Petr Vileta"
    <> wrote:

    >I rather use
    > ppm search Win32::GUI


    Strange:

    C:\temp>ppm search Win32::GUI
    Downloading ActiveState Package Repository packlist...done
    Updating ActiveState Package Repository database...done
    Downloading uwinnipeg packlist...not modified
    Downloading bribes packlist...done
    Updating bribes database...done
    Downloading trouchelle packlist...not modified
    Downloading SoulCage packlist...done
    Downloading SoulCage AppConfig PPD...not modified
    Downloading SoulCage Class-Loader PPD...not modified
    Downloading SoulCage Convert-ASCII-Armour PPD...not modified
    Downloading SoulCage Convert-ASN1 PPD...not modified
    Downloading SoulCage Convert-PEM PPD...not modified
    Downloading SoulCage Crypt-Blowfish PPD...not modified
    Downloading SoulCage Crypt-DES PPD...not modified
    Downloading SoulCage Crypt-DES_EDE3 PPD...not modified
    Downloading SoulCage Crypt-DH PPD...not modified
    Downloading SoulCage Crypt-DSA PPD...not modified
    Downloading SoulCage Crypt-Random PPD...not modified
    Downloading SoulCage Crypt-Rijndael PPD...not modified
    Downloading SoulCage Data-Buffer PPD...not modified
    Downloading SoulCage Digest-BubbleBabble PPD...not modified
    Downloading SoulCage IO-Select-Trap PPD...not modified
    Downloading SoulCage Math-Pari PPD...not modified
    Downloading SoulCage Net-SFTP PPD...not modified
    Downloading SoulCage Net-SSH-Perl PPD...not modified
    Downloading SoulCage Net-SSH-W32Perl PPD...not modified
    Downloading SoulCage Template-Toolkit PPD...not modified
    1: Win32-GUI
    Perl-Win32 Graphical User Interface Extension
    Version: 1.03
    Author: Robert May ()
    Provide: BuildTools version 0.01
    Provide: Config_mO
    Provide: SrcParser version 0.01
    Provide: Win32::GUI version 1.03
    Provide: Win32::GUI::BitmapInline version 0.01
    Provide: Win32::GUI::GridLayout version 0.03
    Repo: ActiveState Package Repository
    CPAN: http://search.cpan.org/dist/Win32-GUI-1.03/
    Installed: 1.03 (site)


    Michele
    --
    {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
    (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
    ..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
    256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
     
    Michele Dondi, Jul 13, 2007
    #15
  16. Petr Vileta wrote:
    > Michele Dondi wrote:
    >> On Fri, 13 Jul 2007 13:29:50 +0200, "Lambik" <>
    >> wrote:
    >>
    >>> Then I would say: Either you've installed the wrong one (when two
    >>> are listed) or you have made a typo in the repository. Because it is
    >>> really there.

    >>
    >> Well, I just did
    >>
    >> ppm install Win32::GUI
    >>
    >> perhaps the order of the repositories does matter? I assumed the most
    >> up to date available version would have been chosen...
    >>
    >>
    >> Michele

    > I rather use
    > ppm search Win32::GUI
    > and in next step
    > ppm install X
    > where "X" is the number of package what I want to select from list
    > --
    >
    > Petr Vileta, Czech republic
    > (My server rejects all messages from Yahoo and Hotmail. Send me your
    > mail from another non-spammer site please.)


    That should be:
    ppm search Win32-GUI

    They use a hyphen as a separate instead of double colon.

    --
    CL
     
    Clenna Lumina, Jul 13, 2007
    #16
  17. On Fri, 13 Jul 2007 08:55:49 -0700, "Clenna Lumina"
    <> wrote:

    >That should be:
    > ppm search Win32-GUI
    >
    >They use a hyphen as a separate instead of double colon.


    Well, the new version of ppm seems to support the double colon too.
    But indeed it only finds version 1.05 of the package doing as you
    suggest.


    Michele
    --
    {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
    (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
    ..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
    256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
     
    Michele Dondi, Jul 13, 2007
    #17
  18. still me

    RobMay Guest

    On Jul 13, 9:58 am, Michele Dondi <> wrote:
    > On Thu, 12 Jul 2007 17:28:05 -0700, RobMay <>
    > wrote:
    >
    > >What version of Win32::GUI, and what version of perl? I fixed the

    >
    > C:\temp>perl -v
    >
    > This is perl, v5.8.8 built for MSWin32-x86-multi-thread
    > (with 50 registered patches, see perl -V for more detail)
    >
    > Copyright 1987-2006, Larry Wall
    >
    > Binary build 820 [274739] provided by ActiveStatehttp://www.ActiveState.com
    > Built Jan 23 2007 15:57:46
    >
    > C:\temp>perl -MWin32::GUI=99 -e1
    > Win32::GUI version 99 required--this is only version 1.03 at
    > C:/Programmi/Perl/l
    > ib/Exporter/Heavy.pm line 121.
    > BEGIN failed--compilation aborted.


    OK. Most of the POD was missing from the 1.03 PPM release (and 1.04 I
    think) - there was a set of correct HTML pages in this release, but if
    you have a latest ActiveState Perl with PPM V4 (which you do), then it
    ignores the distributed HTML and tries to re-build it from the POD
    (earlier version of PPM did not do this). So in your case there's
    (almost) no POD in the distribution, and PPM throws away the
    distributed HTML.

    I'd thoroughly recommend upgrading to 1.05, as there are a lot of bug
    fixes and improvements since 1.03 - I see that you are looking at this
    elsewhere in the thread.

    Regards,
    Rob.
     
    RobMay, Jul 14, 2007
    #18
  19. On Sat, 14 Jul 2007 06:08:32 +0200, "Petr Vileta"
    <> wrote:

    >Try
    > ppm rep
    >or
    > ppm help rep
    >
    >My reporitories are these:
    >
    >ppm> rep describe


    BTW: I now have ppm V4, which either starts a GUI or runs specific
    actions from the cli, too bad it has not retained a cli of its own.


    Michele
    --
    {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
    (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
    ..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
    256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
     
    Michele Dondi, Jul 14, 2007
    #19
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joel Barsotti

    validation with alert pop ups

    Joel Barsotti, Aug 8, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    357
    Steve C. Orr, MCSD
    Aug 8, 2003
  2. buran
    Replies:
    1
    Views:
    6,172
    Dimitri Glazkov
    Dec 29, 2004
  3. Mersh
    Replies:
    0
    Views:
    491
    Mersh
    Mar 13, 2007
  4. Ganesh
    Replies:
    0
    Views:
    554
    Ganesh
    Jun 29, 2007
  5. Navin
    Replies:
    1
    Views:
    699
    Ken Schaefer
    Sep 9, 2003
Loading...

Share This Page