views:

190

answers:

2

I'm following an online Win32::Gui tutorial to learn how to add a GUI to my Perl application. So far everything's been good. But I'm having some pesky small problems. So I'm asking for help here again.

One problem is, I have to click my mouse in the textfield before I can type. I tried something lie this:

$Object->AddTextfield(
        -name   => "Birthday",
        -left   => 75,
        -top    => 50,
        -width  => 180,
        -height => 20,
        -number => 1,
        -prompt => "Input birthday:",  

    );


$Object->Birthday->GetFocus();
$Object->Birthday->Activate();

But it doesn't work. Can anyone kindly help? Thanks in advance.

+2  A: 

how about $Object->Birthday->SetFocus()?

ax
@ax, Thanks. But test failed.
Mike
@ax, wow, it actually works!
Mike
@ax, I dunno what just happened. But now setfocus() is working :) Haha, thanks a lot dude !
Mike
A: 

Birthday->SetFocus() will work fine....

you can try

Rahul
Yes, @Rahul. SetFocus() does work. That's why I accepted the solution offered by @ax. Thanks anyway.
Mike