Hi there, I have some nested check boxes (checkbuttons) in a group that I want to enable/disable based on when another checkbutton is set. This is what I want to do.. (1) Before/unchecked - sub item disabled: ----- [ ] include options? [ ] _sub-checkbox_ (greyed/disabled) ----- (2) After/checked - sub item enabled: ----- [v] include options? [ ] sub-checkbox (enabled) ----- I googled for help or examples but didn''t find anything. Suggestions? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20100223/d80fe815/attachment.html>
2010/2/23 Paul Carvalho <tester.paul at gmail.com>:> Hi there, > > I have some nested check boxes (checkbuttons) in a group that I want to > enable/disable based on when another checkbutton is set.Just connect event handler to the main one and make it gray/degray the other one. -- Matma Rex - http://matma-rex.prv.pl/
2010/2/25 Bartosz Dziewo?ski wrote:> > I have some nested check boxes (checkbuttons) in a group that I want to > > enable/disable based on when another checkbutton is set. > > Just connect event handler to the main one and make it gray/degray the > other one. > >Sorry, I''m a beginner. Do you know if there are any example scripts that show this behaviour? To be honest, I have no idea how to do what you describe. I googled for hours to try and find something to help me. I even skimmed through the FXRuby book but didn''t find an example like this. Granted, I haven''t read the whole book yet, so it''s possible the answer might be in there somewhere. To make it more interesting, I actually want to do this twice in the same list. That is: ----- [ ] include all (enables/disables all below) [] item 1 [] item 2, include sub-list (enables/disables nested sub-items) [] sub-item 1 [] sub-item 2 [] item 3 ----- Thanks for the reply. Cheers! Paul. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20100225/a2dc4d4e/attachment.html>
Here: http://pastebin.com/rPKJLC9r (I hate pasting code into emails) Actually, disabling something turned out to be more complicated than I thought, so I borrowed a bit of code from http://www.fxruby.org/examples/scribble.rb. Sorry for confusing you. -- Matma Rex - http://matma-rex.prv.pl/
Terrific! Thank you for the example. It gives me enough to learn from and play with. Thanks. Have a great weekend! 2010/2/25 Bartosz Dziewo?ski> Here: http://pastebin.com/rPKJLC9r (I hate pasting code into emails) > > Actually, disabling something turned out to be more complicated than I > thought, so I borrowed a bit of code from > http://www.fxruby.org/examples/scribble.rb. Sorry for confusing you. > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20100226/aaf33b19/attachment-0001.html>