Glenn,

I wouldn't expect it to prevent it from being checked. Do you expect this
behaviour from the Windows control itself or from Win32::GUI? Certain
actions for some controls have a "pre-change" notification (e.g. the
TCN_SELCHANGING notification sent when a tab is *about* to change), which
can be used to prevent the change, but I don't see anything like that on
MSDN for a checkbox.

Or do you expect this from Win32::GUI? I know a return value of 0 prevents
the "default action" from taking place, but I see that as a "post-change"
action, if that makes sense. (I'm not sure where that action is defined). 

Or am I missing your point entirely?

Glenn2

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:perl-
> [EMAIL PROTECTED] On Behalf Of Glenn
> Linderman
> Sent: 24 April 2007 13:39
> To: GUI
> Subject: [perl-win32-gui-users] disabling the check on a checkbox???
> 
> use strict;
> use warnings;
> 
> use Win32::GUI();
> 
> my $mw;
> 
> $mw = new Win32::GUI::Window(
>     -name         => "mw",
>     -title        => "Checkbox default action",
>     -pos          => [100, 100],
>     -size         => [200, 200],
>     -dialogui     => 1,
> );
> 
> $mw->AddCheckbox(
>       -name   => "cb",
>       -text   => 'click me',
>       -pos    => [10, 20],
>       -tabstop  => 1,
>       -onClick => sub { return 0; },
> );
> 
> 
> $mw->Show();
> Win32::GUI::Dialog();
> 
> 
> Why does the above program allow the checkbox to be checked and
> unchecked?  Why doesn't the -onClick handler, which returns 0, prevent
> the box from being checked?
> 
> --
> Glenn -- http://nevcal.com/
> ===========================
> A protocol is complete when there is nothing left to remove.
> -- Stuart Cheshire, Apple Computer, regarding Zero Configuration
> Networking
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Perl-Win32-GUI-Users mailing list
> Perl-Win32-GUI-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> http://perl-win32-gui.sourceforge.net/


Reply via email to