Add the following before your "$W ->Show;":

$W->{-dialogui} = 1;

and it should make the Window act like a DialogBox.

Use Jeremy's suggestion to put the cursor in the textfield.

Jonathan Southwick
Technical & Network Services
Allegheny College, Meadsville, PA
[EMAIL PROTECTED]


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <perl-win32-gui-users@lists.sourceforge.net>
Sent: Tuesday, March 13, 2001 12:40 PM
Subject: [perl-win32-gui-users] RE: [perl-win32-gui-users]Why Do I have to
use the Mouse???


> Can Anybody help here.
> At the moment I have to click on the textbox to highlight it before I can
> enter anything and then I have to use the mouse to click validate it....
> All I want is, When the progran start's the first textbox is already
> highlighted and to submit it all I have to do is press Enter,
> I am driven soft that something so trivial is anything But !!!!
> or is it the softness in the brain has brought me to a point in my
existence
> from where there is nowhere to progress.
>
> here it is
>     ||
>     ||
>     ||
>     \/
>
> use strict;
> use Win32::GUI;
>
> my $MWfont = Win32::GUI::Font->new(
> -name => "Arial",
> -size => 16,
> );
>
> my $W = new Win32::GUI::Window(
>     -name   => "W",
>     -text   => "Work....Let You    !!!!!",
>     -left   => 0,
>     -top    => 0,
>     -width  => 640,
>     -height => 480,
> -font  => $MWfont,
> );
>
> $W->AddTextfield(
>     -name   => "Input",
> -font => $MWfont,
> -left   => 20,
>     -top    => 40,
>     -width  => 100,
>     -height => 25,
>     -text   => "",
> -prompt => [ "Enter ????  :  ", 100 ],
> ,
> );
>
>
> $W->AddButton(
>     -text    => '&Validate',
>     -name    => 'CmdValidate',
>     -left    => 250,
>     -top     => 40,
>     -default => 1,
>     -ok      => 1,
> -height => 25,
>     -width   => 80,
> );
>
>
> $W->AddTextfield(
>     -name      => "Display",
>     -readonly  => 1,
>     -multiline => 1,
>     -left      => 40,
>     -top       => 130,
>     -width     => 540,
>     -height    => 120,
>     -text      => "I'm a placeholder",
> -foreground => [255,255,255],
> -background =>[0, 0, 255],
> );
>
> $W->AddStatusBar(
>     -name => "Status",
>     -text => "What Will I Look For Today  .",
> );
> $W ->Show;
> Win32::GUI::Dialog();
>
> sub MainWindow_Terminate {
>     PostQuitMessage(1);
> }
>
>
> #=============
> sub W_Resize {
> #=============
>     $W->Status->Move(0, $W->ScaleHeight-$W->Status->Height);
>     $W->Status->Resize($W->ScaleWidth, $W->Status->Height);
>     return 1;
> }
>
> #===============
> sub Exit_Click {
> #===============
>     return -1;
> }
>
> #===============
> sub CmdValidate_Click {
> #===============
> $W->Display->{-text} = 'Whaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
> }
>
>
> Rgds  Eoin:
> EMF2 Test Engineering
> mailto:[EMAIL PROTECTED]
>
>
>
>
> _______________________________________________
> Perl-Win32-GUI-Users mailing list
> Perl-Win32-GUI-Users@lists.sourceforge.net
> http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
>


Reply via email to