Tim Simpson wrote:
>I started out with the hello.pl script
>and tried to add a couple of checkboxes to it which appear on the screen
>ok
>
>but as soon as I add the code which I think is for checking they are
checked
>a tick no longer appears in the box although I do get passed to the click
>subroutine


it's easier than you think; you don't need to manually check or uncheck the
checkbox inside the event routine (technically speaking, checkboxes are by
default created with the BS_AUTOCHECKBOX style, so they take care of
checking
for themselves).
so you need to remove this line:

    $rad1->Checked(($rad1->Checked) ? 0 : 1);

this will actually toggle the checkbox twice, resulting in no effect.

>I also do not know how to actually check if the checkbox is checked


this is done by the Checked() method, which returns 1 if it's checked,
0 if it's not.
this is an example of a Click subroutine:

sub rad1_Click {
    print STDOUT "in rad1 click\n";
    if($rad1->Checked) {
        print STDOUT "rad1 is checked\n";
    } else {
        print STDOUT "rad1 is NOT checked\n";
    }
}

HTH.

Bye,
Aldo Calpini
<[EMAIL PROTECTED]>

 LIBERA ME DOMINE DE MORTE AETERNA
 IN DIE ILLA TREMENDA
 QUANDO COELI MOVENDI SUNT
 ET TERRA






Reply via email to