basic optionbutton help

Klaus Major klausimausi at mac.com
Thu Jan 23 11:12:01 EST 2003


Hi sschofield,

> This is obviously so easy to do I am missing the point. I've got 2 
> radio
> buttons, Male and Female (would like them Sex(0) and Sex(1) but 
> couldn't
> work that out either). Now what?
>
> I've gone to the manual, put in the
>      group button "Male" and button "Female"                }as per 
> manual

OK.

>      set the radioBehavior of last group to true            }as per 
> manual

Not necessary if there are only radiobuttons in that group.
Then the group knows how to "behave".

>      put false into button "Male"                           
> }unsuccessful

This is the trick:

set the hilitedbuttonname of last grp to "female"
## i recommend to name the group for further reference...

> attempt to set it back to false
>      put false into button "Female"                         }ditto
>
> But nothing seems to happen.

See above...

> I then have a line on mousedown in button Male
> on mousedown

Put this into the script of the group, no scripts in the buttons...

on mouseup
   if the hilitedbuttonname of me = "Male" the
     put "you pretend to be male" into field "MyMessage"
   else
     put "you pretend to be female" into field "MyMessage"
   end if
end mouseup


Hope that helps.

Have a nice day :-)


Regards

Klaus Major
klausimausi at mac.com




More information about the use-livecode mailing list