[Perl] Perl y Windows, Dolor de cabeza.

Max de Mendizábal max en upn.mx
Mie Jun 9 08:51:33 CDT 2004


De la documentación del Active State Perl http://www.activestate.com

"Is there a way to do GUI programming with ActivePerl?

As of the Perl Resource Kit for Win32, the Tk library has been 
successfully ported to ActivePerl. Tk version 8xx and above also now has 
the look and feel of Windows programs, and not the old UNIX look of 
previous versions.

You can also use the Win32::GUI module which also allows for GUI's to be 
made/manipulated using Perl. This module uses the standard Windows widgets 
to give the look and feel of Windows programs.

For Tk information, go to http://w4.lns.cornell.edu/~pvhp/ptk/ptkTOC.html

For Win32::GUI, go to http://dada.perl.it

Win32::MsgBox allows for a fast and easy way to display a Windows message 
box, for example:

    use Win32;

    MsgBox("Test", "This is a test", 48);
    # display a message box with an exclamation mark and an 'Ok' button

    sub MsgBox {
        my ($caption, $message, $icon_buttons) = @_;
        my @return = qw/- Ok Cancel Abort Retry Ignore Yes No/;
        my $result = Win32::MsgBox($message, $icon_buttons, $caption);
        return $return[$result];
    }

The last value, $icon_buttons, is the sum of two values, the value for the 
icon and the value for the buttons. For example, if you need a message box 
with a question mark and the 'Ok' and 'Cancel' buttons the value you want 
is 32 (question mark) + 1 (Ok, Cancel) = 39. The values are listed here:

    Icons:
       0 - no icon
      16 - Hand
      32 - Question
      48 - Exclamation
      64 - Asterisk

    Buttons:
       0 - Ok
       1 - Ok, Cancel
       2 - Abort, Retry, Ignore
       3 - Yes, No, Cancel
       4 - Yes, No
       5 - Retry, Cancel
"

El ejemplo que está allí jala a la primera.

Saludos
Max
 
On Wed, 9 Jun 2004, Rafael F. [iso-8859-15] Rodríguez wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hola a todos.
> 
> 	Pues eso, ya tengo algunos scripts para ejecutar en windows y que actualiza 
> algunas bases de datos, lo que ocurre es que todo me sale en pantalla de DOS, 
> me gustaría saber como puedo hacer que salga una venta que diga "YA TA" y ok.
> 
> 	He buscado información sobre programación de ventanas en perl y la verdad, me 
> parece un parto, y cada vez que me pongo me dá dolor de cabeza, ¿algun manual 
> en español donde lo explique de forma más o menos sencilla?. 
> 
> 	Muchas gracias.
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (GNU/Linux)
> 
> iD8DBQFAxu3NgH5COkHoO4sRAsgyAJ9OXCJogUEshY4sgR9+gTFpZm1uCgCeIpd9
> ROELMYzOSGyjgTLrEjz1LEg=
> =f2lA
> -----END PGP SIGNATURE-----
> 
> 



Más información sobre la lista de distribución Perl