I would change it to:

$my_but->Enable();
$my_but->Disable();

instead of trying to change the -disabled parameter of the button itself.



> -----Original Message-----
> From: Vassiliy Truskov [mailto:vassiliy.truskov@sand.com]
> Sent: Friday, December 03, 2004 3:55 PM
> To: perl-win32-gui-users@lists.sourceforge.net
> Subject: [perl-win32-gui-users] Button disabled ?
>
>
> Hello, everybody.
>
> I'm having a problem with Button view when i set status as
> 'disabled =>
> 0'. After I change status of button to "disabled => 1',
> I'm able to push button, but is still has a gray status
> "disabled". It
> will be 'viewable' after i change status back to "disabled"
> Here is a simple code to reproduce the problem:
>
>
> use Win32::GUI;
>
> $W = new Win32::GUI::Window(
>     -title    => "Win32::GUI::Button test",
>     -left     => 100,
>     -top      => 100,
>     -width    => 360,
>     -height   => 260,
>     -name     => "Window",
> );
>
> $i = 0;
> $my_but = $W->AddButton(
>     -name => "Sample",
>     -left => 5,
>     -top  => 5,
>     -text => "Click button",
>     -disabled => 1,
> );
>
> $check1 = $W->AddCheckbox(
>     -name => "Check1",
>     -left => 8,
>     -top  => 50,
>     -text => "Checkbox 1",
> );
>
> $W->Show;
>
> Win32::GUI::Dialog();
>
> sub Window_Terminate {
>     return -1;
> }
>
>
> sub Check1_Click {
>   if($i==0)
>   {
>     $my_but->Change(-disabled => 0);
>     $i = 1;
>   } else {
>     $my_but->Change(-disabled => 1);
>     $i = 0;
>   }
>   return 1;
> }
>
>
> Any help is appreciated,
>
> Vassiliy
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from
> real users.
> Discover which products truly live up to the hype. Start reading now.
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Perl-Win32-GUI-Users mailing list
> Perl-Win32-GUI-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
>
>
>
> __________________________________________________________
> Message transport security by GatewayDefender.com
> 3:56:24 PM ET - 12/3/2004
>